diff --git a/_compile.php b/_compile.php index 29118193..19e4deec 100644 --- a/_compile.php +++ b/_compile.php @@ -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)])) { diff --git a/abstraction.inc.php b/abstraction.inc.php index 3824e0d8..3d65a42d 100644 --- a/abstraction.inc.php +++ b/abstraction.inc.php @@ -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]; } diff --git a/todo.txt b/todo.txt index e5e84070..5adde629 100644 --- a/todo.txt +++ b/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