X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=install-utils.inc;h=33109a68c79a14ce37101635bcc4a60e4237f85f;hb=65ddb10966a25c5f7e49eff5fbc1de291e9ee9ef;hp=f9842476a12fd3e068f5678f6cddc5965b879483;hpb=8d5959de56eecba0be23d69e40ba7af79ead4459;p=lhc%2Fweb%2Fwiklou.git diff --git a/install-utils.inc b/install-utils.inc index f9842476a1..33109a68c7 100644 --- a/install-utils.inc +++ b/install-utils.inc @@ -1,25 +1,28 @@ -sourceFile( $fname ); + if ( $error !== true ) { + print $error; + exit(1); + } } - +# Obsolete, use Database::fieldExists() function field_exists( $table, $field ) { - $fname = "Update script: field_exists"; - $res = wfQuery( "DESCRIBE $table", $fname ); + $fname = 'Update script: field_exists'; + $db =& wfGetDB( DB_SLAVE ); + $res = $db->query( "DESCRIBE $table", $fname ); $found = false; - - while ( $row = wfFetchObject( $res ) ) { + + while ( $row = $db->fetchObject( $res ) ) { if ( $row->Field == $field ) { $found = true; break; @@ -135,7 +124,7 @@ function field_exists( $table, $field ) { return $found; } - +# Obsolete Database::tableExists() function table_exists( $db ) { global $wgDBname; $res = mysql_list_tables( $wgDBname ); @@ -149,6 +138,7 @@ function table_exists( $db ) { return false; } +# Obsolete, use Database:fieldInfo() function field_info( $table, $field ) { $res = mysql_query( "SELECT * FROM $table LIMIT 1" ); $n = mysql_num_fields( $res );