# HG changeset patch # User Dan Fuhry # Date 1377138894 14400 # Node ID fa2b0825bbc535d3e3e9828eb292f098e0f1a5bb # Parent 60b580d22c7bdfd0bf41ad5a65d7ab1af814e55f Removed unused/seldom-used DBAL functions that weren't entirely supported in PDO diff -r 60b580d22c7b -r fa2b0825bbc5 includes/dbal.php --- a/includes/dbal.php Wed Aug 21 22:13:58 2013 -0400 +++ b/includes/dbal.php Wed Aug 21 22:34:54 2013 -0400 @@ -423,23 +423,6 @@ } /** - * Set the internal result pointer to X - * @param int $pos The number of the row - * @param resource $result The MySQL result resource - if not given, the latest cached query is assumed - * @return true on success, false on failure - */ - - function sql_data_seek($pos, $result = false) - { - if ( !$result ) - $result = $this->latest_result; - if ( !$result ) - return false; - - return mysql_data_seek($result, $pos) ? true : false; - } - - /** * Reports a bad query to the admin * @param string $query the naughty query * @access private @@ -559,16 +542,6 @@ } /** - * Returns the number of rows affected. - * @return int - */ - - function sql_affectedrows() - { - return mysql_affected_rows($this->_conn); - } - - /** * Get MySQL server version * @return string */ @@ -1084,23 +1057,6 @@ } /** - * Set the internal result pointer to X - * @param int $pos The number of the row - * @param resource $result The MySQL result resource - if not given, the latest cached query is assumed - * @return true on success, false on failure - */ - - function sql_data_seek($pos, $result = false) - { - if ( !$result ) - $result = $this->latest_result; - if ( !$result ) - return false; - - return mysql_data_seek($result, $pos) ? true : false; - } - - /** * Reports a bad query to the admin * @param string $query the naughty query * @access private @@ -1225,16 +1181,6 @@ } /** - * Returns the number of rows affected. - * @return int - */ - - function sql_affectedrows() - { - return mysql_affected_rows($this->_conn); - } - - /** * Get MySQL server version * @return string */ @@ -1255,9 +1201,8 @@ function close() { // anything we locked should certainly be unlocked now; - @mysql_query("COMMIT;", $this->_conn); - @mysql_query("UNLOCK TABLES;", $this->_conn); - @mysql_close($this->_conn); + $this->sql_query("COMMIT;", $this->_conn); + $this->sql_query("UNLOCK TABLES;", $this->_conn); unset($this->_conn); } @@ -1691,23 +1636,6 @@ } /** - * Set the internal result pointer to X - * @param int $pos The number of the row - * @param resource $result The PostgreSQL result resource - if not given, the latest cached query is assumed - * @return true on success, false on failure - */ - - function sql_data_seek($pos, $result = false) - { - if ( !$result ) - $result = $this->latest_result; - if ( !$result ) - return false; - - return pg_result_seek($result, $pos) ? true : false; - } - - /** * Reports a bad query to the admin * @param string $query the naughty query * @access private @@ -1921,16 +1849,6 @@ } /** - * Returns the number of rows affected. - * @return int - */ - - function sql_affectedrows() - { - return pg_affected_rows($this->latest_result); - } - - /** * Generates and outputs a report of all the SQL queries made during execution. Should only be called after everything's over with. */ diff -r 60b580d22c7b -r fa2b0825bbc5 plugins/SpecialPageFuncs.php --- a/plugins/SpecialPageFuncs.php Wed Aug 21 22:13:58 2013 -0400 +++ b/plugins/SpecialPageFuncs.php Wed Aug 21 22:34:54 2013 -0400 @@ -376,8 +376,7 @@ global $lang; $platform = 'Unknown'; - $uname = @file_get_contents('/proc/sys/kernel/ostype'); - if($uname == "Linux\n") + if(strtolower(PHP_OS) === 'linux') $platform = 'Linux'; else if(@file_exists('/hurd/pfinet')) // I have a little experience with GNU/Hurd :-) http://hurdvm.enanocms.org/ $platform = 'GNU/Hurd'; @@ -493,7 +492,7 @@ { case 'MYSQL': ?> - get('meta_enano_about_lbl_mysqlversion'); ?>_conn); ?> + get('meta_enano_about_lbl_mysqlversion'); ?>get_server_version(); ?> get('acplm_portal_btn_edit'); $btn_unin = $lang->get('acplm_portal_btn_unin'); + $rows = array(); + while ( $row = $db->fetchrow($q) ) { + $rows[] = $row; + $cls = ( $cls == 'row1' ) ? 'row2' : 'row1'; echo ''; @@ -569,11 +573,7 @@ echo ''; - // Reset the result pointer to zero so we can fetch that list of languages again - if ( !$db->sql_data_seek(0, $q) ) - { - $db->_die('LangManager doing seek back to zero for installation blacklist'); - } + $db->free_result(); // $lang_list is fetched by the posthandler sometimes if ( !isset($lang_list) ) @@ -583,7 +583,7 @@ $lang_list = list_available_languages(); } - while ( $row = $db->fetchrow($q) ) + foreach ( $rows as $row ) { $lang_code =& $row['lang_code']; if ( isset($lang_list[$lang_code]) )