mirror of
https://github.com/vrana/adminer.git
synced 2025-08-10 08:34:20 +02:00
$_result is not needed for minification
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@584 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -127,7 +127,7 @@ function php_shrink($input) {
|
||||
} elseif ($token[0] === T_VARIABLE && !isset($special_variables[$token[1]])) {
|
||||
$token[1] = '$' . $short_variables[$token[1]];
|
||||
} elseif ($token[0] === T_STRING && $tokens[$i+1] === '(' && isset($defined_functions[$token[1]])
|
||||
&& $tokens[$i-1][0] !== T_DOUBLE_COLON && $tokens[$i-2][0] !== T_NEW && !in_array($tokens[$i-2][1], array('_result', '$_result'), true)
|
||||
&& $tokens[$i-1][0] !== T_DOUBLE_COLON && $tokens[$i-2][0] !== T_NEW && $tokens[$i-2][1] !== '_result'
|
||||
) {
|
||||
$token[1] = $short_functions[$token[1]];
|
||||
} elseif ($token[0] == T_CONSTANT_ENCAPSED_STRING && (($tokens[$i-1] === '(' && in_array($tokens[$i-2][1], array('array_map', 'set_exception_handler'), true)) || $token[1] == "'normalize_enum'") && isset($defined_functions[substr($token[1], 1, -1)])) {
|
||||
|
@@ -191,19 +191,19 @@ if (extension_loaded("mysqli")) {
|
||||
}
|
||||
|
||||
function query($query) {
|
||||
$_result = parent::query($query);
|
||||
if (!$_result) {
|
||||
$result = parent::query($query);
|
||||
if (!$result) {
|
||||
$errorInfo = $this->errorInfo();
|
||||
$this->error = $errorInfo[2];
|
||||
return false;
|
||||
}
|
||||
$this->_result = $_result;
|
||||
if (!$_result->columnCount()) {
|
||||
$this->affected_rows = $_result->rowCount();
|
||||
$this->_result = $result;
|
||||
if (!$result->columnCount()) {
|
||||
$this->affected_rows = $result->rowCount();
|
||||
return true;
|
||||
}
|
||||
$_result->num_rows = $_result->rowCount();
|
||||
return $_result;
|
||||
$result->num_rows = $result->rowCount();
|
||||
return $result;
|
||||
}
|
||||
|
||||
function multi_query($query) {
|
||||
@@ -218,11 +218,11 @@ if (extension_loaded("mysqli")) {
|
||||
return $this->_result->nextRowset();
|
||||
}
|
||||
|
||||
function result($_result, $field = 0) {
|
||||
if (!$_result) {
|
||||
function result($result, $field = 0) {
|
||||
if (!$result) {
|
||||
return false;
|
||||
}
|
||||
$row = $_result->fetch();
|
||||
$row = $result->fetch();
|
||||
return $row[$field];
|
||||
}
|
||||
|
||||
|
2
todo.txt
2
todo.txt
@@ -10,4 +10,4 @@ Function to fix database encoding - http://php.vrana.cz/prevod-kodovani-mysql.ph
|
||||
? Execution time in sql.inc.php
|
||||
? Save token also to cookie - for session expiration and login in other window
|
||||
? Save uploaded files after error to session variable instead of hidden field
|
||||
? Aliasing of built-in functions can save 7 KB, substitution of $_GET and friends can save 2 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB
|
||||
? Aliasing of built-in functions can save 7 KB, substitution of $_GET and friends can save 2 KB, remove of base64_decode() + using chars 127-255 in minification can save 1 KB, JS shrink can save 1 KB
|
||||
|
Reference in New Issue
Block a user