diff --git a/adminer/drivers/mysql.inc.php b/adminer/drivers/mysql.inc.php index 55d31df8..11c3314f 100644 --- a/adminer/drivers/mysql.inc.php +++ b/adminer/drivers/mysql.inc.php @@ -202,7 +202,7 @@ if (!defined("DRIVER")) { /** Free result set */ function __destruct() { - mysql_free_result($this->_result); //! not called in PHP 4 which is a problem with mysql.trace_mode + mysql_free_result($this->_result); } } diff --git a/compile.php b/compile.php index cf64a20c..3d6b683b 100755 --- a/compile.php +++ b/compile.php @@ -394,5 +394,5 @@ $file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file); $file = php_shrink($file); $filename = $project . (preg_match('~-dev$~', $VERSION) ? "" : "-$VERSION") . ($driver ? "-$driver" : "") . ($_SESSION["lang"] ? "-$_SESSION[lang]" : "") . ".php"; -fwrite(fopen($filename, "w"), $file); // file_put_contents() since PHP 5 +file_put_contents($filename, $file); echo "$filename created (" . strlen($file) . " B).\n"; diff --git a/editor/include/editing.inc.php b/editor/include/editing.inc.php index 62867047..32d3f4ef 100644 --- a/editor/include/editing.inc.php +++ b/editor/include/editing.inc.php @@ -4,7 +4,7 @@ * @return string */ function email_header($header) { - // iconv_mime_encode requires PHP 5, imap_8bit requires IMAP extension + // iconv_mime_encode requires iconv, imap_8bit requires IMAP extension return "=?UTF-8?B?" . base64_encode($header) . "?="; //! split long lines } diff --git a/lang.php b/lang.php index c289e546..28ce433d 100755 --- a/lang.php +++ b/lang.php @@ -56,7 +56,7 @@ foreach (glob(dirname(__FILE__) . "/adminer/lang/" . ($_SESSION["lang"] ? $_SESS } $s = "_findRootClass($class), 'Adminer')) { // can use interface since PHP 5 + if (preg_match('~^Adminer.~i', $class) && strcasecmp($this->_findRootClass($class), 'Adminer')) { //! can use interface $plugins[$class] = new $class; } } } $this->plugins = $plugins; - // it is possible to use ReflectionObject in PHP 5 to find out which plugins defines which methods at once + //! it is possible to use ReflectionObject to find out which plugins defines which methods at once } function _callParent($function, $args) { - switch (count($args)) { // call_user_func_array(array('parent', $function), $args) works since PHP 5 - case 0: return parent::$function(); - case 1: return parent::$function($args[0]); - case 2: return parent::$function($args[0], $args[1]); - case 3: return parent::$function($args[0], $args[1], $args[2]); - case 4: return parent::$function($args[0], $args[1], $args[2], $args[3]); - case 5: return parent::$function($args[0], $args[1], $args[2], $args[3], $args[4]); - case 6: return parent::$function($args[0], $args[1], $args[2], $args[3], $args[4], $args[5]); - default: trigger_error('Too many parameters.', E_USER_WARNING); - } + return call_user_func_array(array('parent', $function), $args); } function _applyPlugin($function, $args) {