Use PHP 5
This commit is contained in:
parent
961ec0b857
commit
85d212c226
|
@ -202,7 +202,7 @@ if (!defined("DRIVER")) {
|
||||||
/** Free result set
|
/** Free result set
|
||||||
*/
|
*/
|
||||||
function __destruct() {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -394,5 +394,5 @@ $file = preg_replace("~<\\?php\\s*\\?>\n?|\\?>\n?<\\?php~", '', $file);
|
||||||
$file = php_shrink($file);
|
$file = php_shrink($file);
|
||||||
|
|
||||||
$filename = $project . (preg_match('~-dev$~', $VERSION) ? "" : "-$VERSION") . ($driver ? "-$driver" : "") . ($_SESSION["lang"] ? "-$_SESSION[lang]" : "") . ".php";
|
$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";
|
echo "$filename created (" . strlen($file) . " B).\n";
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function email_header($header) {
|
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
|
return "=?UTF-8?B?" . base64_encode($header) . "?="; //! split long lines
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
lang.php
2
lang.php
|
@ -56,7 +56,7 @@ foreach (glob(dirname(__FILE__) . "/adminer/lang/" . ($_SESSION["lang"] ? $_SESS
|
||||||
}
|
}
|
||||||
$s = "<?php\n\$translations = array(\n$s);\n";
|
$s = "<?php\n\$translations = array(\n$s);\n";
|
||||||
if ($s != $file) {
|
if ($s != $file) {
|
||||||
fwrite(fopen($filename, "w"), $s); // file_put_contents() since PHP 5
|
file_put_contents($filename, $s);
|
||||||
echo "$filename updated.\n";
|
echo "$filename updated.\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,26 +24,17 @@ class AdminerPlugin extends Adminer {
|
||||||
if ($plugins === null) {
|
if ($plugins === null) {
|
||||||
$plugins = array();
|
$plugins = array();
|
||||||
foreach (get_declared_classes() as $class) {
|
foreach (get_declared_classes() as $class) {
|
||||||
if (preg_match('~^Adminer.~i', $class) && strcasecmp($this->_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;
|
$plugins[$class] = new $class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->plugins = $plugins;
|
$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) {
|
function _callParent($function, $args) {
|
||||||
switch (count($args)) { // call_user_func_array(array('parent', $function), $args) works since PHP 5
|
return call_user_func_array(array('parent', $function), $args);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _applyPlugin($function, $args) {
|
function _applyPlugin($function, $args) {
|
||||||
|
|
Loading…
Reference in a new issue