diff --git a/ChangeLog b/ChangeLog index 1b484976d..165e091c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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. diff --git a/Documentation.html b/Documentation.html index 7574c09f4..f76f33c54 100644 --- a/Documentation.html +++ b/Documentation.html @@ -4112,6 +4112,7 @@ INSERT INTO REL_towns VALUES ('M', 'Montréal'); XML, PCRE and PEAR support. + You either need a SOAP PHP extension or install PEAR SOAP module. On your system command line, run "pear install Net_Socket Net_URL HTTP_Request Mail_Mime Net_DIME SOAP" to get the necessary PEAR modules diff --git a/libraries/sqlvalidator.class.php b/libraries/sqlvalidator.class.php index 3b6847ccb..0f9a6f39b 100644 --- a/libraries/sqlvalidator.class.php +++ b/libraries/sqlvalidator.class.php @@ -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);