SQL validator works also with SOAP PHP extension.

This commit is contained in:
Michal Čihař
2010-07-21 13:17:15 +02:00
parent bc4dc6b9bd
commit 1faec011d0
3 changed files with 32 additions and 9 deletions

View File

@@ -93,6 +93,7 @@ $Id$
navigation.
+ [code] Centralized format string expansion, @VARIABLES@ are recommended way
now.
+ [validator] SQL validator works also with SOAP PHP extension.
3.3.6.0 (not yet released)
- bug #3031705 [core] Do not use CONCAT for DECIMAL fields.

View File

@@ -4112,6 +4112,7 @@ INSERT INTO REL_towns VALUES ('M', 'Montréal');
<abbr title="Extensible Markup Language">XML</abbr>,
<abbr title="Perl Compatible Regular Expressions">PCRE</abbr> and
<abbr title="PHP Extension and Application Repository">PEAR</abbr> support.
You either need a SOAP PHP extension or install PEAR SOAP module.
On your system command line, run <tt>"pear install Net_Socket Net_URL
HTTP_Request Mail_Mime Net_DIME SOAP"</tt> to get the necessary
<abbr title="PHP Extension and Application Repository">PEAR</abbr> modules

View File

@@ -7,9 +7,9 @@
* http://www.orbis-terrarum.net/?l=people.robbat2
*
* All data is transported over HTTP-SOAP
* And uses the PEAR SOAP Module
* And uses either the PEAR SOAP Module or PHP SOAP extension
*
* Install instructions for PEAR SOAP
* Install instructions for PEAR SOAP:
* Make sure you have a really recent PHP with PEAR support
* run this: "pear install Mail_Mime Net_DIME SOAP"
*
@@ -33,11 +33,20 @@ if (! defined('PHPMYADMIN')) {
/**
* Load SOAP client.
*/
@include_once 'SOAP/Client.php';
if (!function_exists('class_exists') || !class_exists('SOAP_Client')) {
$GLOBALS['sqlvalidator_error'] = TRUE;
if (class_exists('SOAPClient')) {
$GLOBALS['sqlvalidator_soap'] = 'PHP';
} else {
@include_once 'SOAP/Client.php';
if (class_exists('SOAP_Client')) {
$GLOBALS['sqlvalidator_soap'] = 'PEAR';
} else {
$GLOBALS['sqlvalidator_soap'] = 'NONE';
$GLOBALS['sqlvalidator_error'] = TRUE;
PMA_warnMissingExtension('soap');
}
}
if (!$GLOBALS['sqlvalidator_error']) {
// Ok, we have SOAP Support, so let's use it!
/**
@@ -79,7 +88,11 @@ if (!function_exists('class_exists') || !class_exists('SOAP_Client')) {
*/
function _openService($url)
{
$obj = new SOAP_Client($url, TRUE);
if ($GLOBALS['sqlvalidator_soap'] == 'PHP') {
$obj = new SOAPClient($url);
} else {
$obj = new SOAP_Client($url, TRUE);
}
return $obj;
} // end of the "openService()" function
@@ -109,7 +122,11 @@ if (!function_exists('class_exists') || !class_exists('SOAP_Client')) {
$interactive)
{
$use_array = array("a_userName" => $username, "a_password" => $password, "a_callingProgram" => $calling_program, "a_callingProgramVersion" => $calling_program_version, "a_targetDbms" => $target_dbms, "a_targetDbmsVersion" => $target_dbms_version, "a_connectionTechnology" => $connection_technology, "a_connectionTechnologyVersion" => $connection_technology_version, "a_interactive" => $interactive);
$ret = $obj->call("openSession", $use_array);
if ($GLOBALS['sqlvalidator_soap'] == 'PHP') {
$ret = $obj->__soapCall("openSession", $use_array);
} else {
$ret = $obj->call("openSession", $use_array);
}
// This is the old version that needed the overload extension
/* $ret = $obj->openSession($username, $password,
@@ -137,7 +154,11 @@ if (!function_exists('class_exists') || !class_exists('SOAP_Client')) {
function _validateSQL($obj, $session, $sql, $method)
{
$use_array = array("a_sessionId" => $session->sessionId, "a_sessionKey" => $session->sessionKey, "a_SQL" => $sql, "a_resultType" => $this->output_type);
$res = $obj->call("validateSQL", $use_array);
if ($GLOBALS['sqlvalidator_soap'] == 'PHP') {
$res = $obj->__soapCall("validateSQL", $use_array);
} else {
$res = $obj->call("validateSQL", $use_array);
}
// This is the old version that needed the overload extension
// $res = $obj->validateSQL($session->sessionId, $session->sessionKey, $sql, $this->output_type);