[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_3_5RC1-5813-g1faec01
Michal Čihař
nijel at users.sourceforge.net
Wed Jul 21 13:17:25 CEST 2010
The branch, master has been updated
via 1faec011d012ba37af49965a87840c071f75a4d1 (commit)
from bc4dc6b9bd6c8e53b12043a7f5d16cbe97a6330e (commit)
- Log -----------------------------------------------------------------
commit 1faec011d012ba37af49965a87840c071f75a4d1
Author: Michal Čihař <mcihar at novell.com>
Date: Wed Jul 21 13:17:15 2010 +0200
SQL validator works also with SOAP PHP extension.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
Documentation.html | 1 +
libraries/sqlvalidator.class.php | 39 +++++++++++++++++++++++++++++--------
3 files changed, 32 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1b48497..165e091 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 7574c09..f76f33c 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -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
diff --git a/libraries/sqlvalidator.class.php b/libraries/sqlvalidator.class.php
index 3b6847c..0f9a6f3 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.
*/
- at 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);
hooks/post-receive
--
phpMyAdmin
More information about the Git
mailing list