Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

update.php

Go to the documentation of this file.
00001 <?php 00002 00003 die("obsolete; remove this file befor 1.3.0 release\n"); 00004 00005 # Update already-installed software 00006 # 00007 00008 include( "./install-utils.inc" ); 00009 require_once( "./maintenance/updaters.inc" ); 00010 install_version_checks(); 00011 00012 if ( ! ( is_readable( "./LocalSettings.php" ) 00013 && is_readable( "./AdminSettings.php" ) ) ) { 00014 print "A copy of your installation's LocalSettings.php\n" . 00015 "and AdminSettings.php must exist in this source directory.\n"; 00016 exit(); 00017 } 00018 00019 $IP = "./includes"; 00020 require_once( "./LocalSettings.php" ); 00021 require_once( "./AdminSettings.php" ); 00022 00023 include( "$IP/Version.php" ); 00024 00025 if( $wgSitename == "MediaWiki" ) { 00026 die( "You must set the site name in \$wgSitename before installation.\n\n" ); 00027 } 00028 00029 if ( $wgUseTeX && ( ! is_executable( "./math/texvc" ) ) ) { 00030 print "To use math functions, you must first compile texvc by\n" . 00031 "running \"make\" in the math directory.\n"; 00032 exit(); 00033 } 00034 00035 # 00036 # Copy files into installation directories 00037 # 00038 do_update_files(); 00039 00040 $wgDBuser = $wgDBadminuser; 00041 $wgDBpassword = $wgDBadminpassword; 00042 00043 require_once( "{$IP}/Setup.php" ); 00044 require_once( "./maintenance/InitialiseMessages.inc" ); 00045 00046 $wgTitle = Title::newFromText( "Update script" ); 00047 00048 # 00049 # Check the database for things that need to be fixed... 00050 # 00051 print "Checking database for necessary updates...\n"; 00052 00053 $wgDatabase = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname, 00054 1, false, true, false); 00055 if ( !$wgDatabase->isOpen() ) { 00056 print "Unable to connect to database: " . $wgDatabase->lastError() . "\n"; 00057 exit(); 00058 } 00059 00060 do_revision_updates(); 00061 00062 do_ipblocks_update(); 00063 do_interwiki_update(); 00064 do_index_update(); 00065 do_linkscc_update(); 00066 do_linkscc_1_3_update(); 00067 do_hitcounter_update(); 00068 do_recentchanges_update(); 00069 do_user_real_name_update(); 00070 00071 initialiseMessages(); 00072 00073 $wgDatabase->close(); 00074 00075 print "Done.\n"; 00076 exit(); 00077 00078 # 00079 # 00080 # 00081 00082 function do_update_files() { 00083 global $IP, $wgStyleSheetDirectory, $wgUploadDirectory, $wgLanguageCode, $wgDebugLogFile; 00084 print "Copying files... "; 00085 00086 copyfile( ".", "LocalSettings.php", $IP ); 00087 copyfile( ".", "index.php", $IP ); 00088 copyfile( ".", "redirect.php", $IP ); 00089 # compatibility with older versions, can be removed in a year or so 00090 # (written in Feb 2004) 00091 copyfile( ".", "wiki.phtml", $IP ); 00092 copyfile( ".", "redirect.phtml", $IP ); 00093 00094 copydirectory( "./includes", $IP ); 00095 copydirectory( "./stylesheets", $wgStyleSheetDirectory ); 00096 00097 copyfile( "./images", "wiki.png", $wgUploadDirectory ); 00098 copyfile( "./images", "button_bold.png", $wgUploadDirectory ); 00099 copyfile( "./images", "button_extlink.png", $wgUploadDirectory ); 00100 copyfile( "./images", "button_headline.png", $wgUploadDirectory ); 00101 copyfile( "./images", "button_hr.png", $wgUploadDirectory ); 00102 copyfile( "./images", "button_image.png", $wgUploadDirectory ); 00103 copyfile( "./images", "button_italic.png", $wgUploadDirectory ); 00104 copyfile( "./images", "button_link.png", $wgUploadDirectory ); 00105 copyfile( "./images", "button_math.png", $wgUploadDirectory ); 00106 copyfile( "./images", "button_media.png", $wgUploadDirectory ); 00107 copyfile( "./images", "button_nowiki.png", $wgUploadDirectory ); 00108 copyfile( "./images", "button_sig.png", $wgUploadDirectory ); 00109 copyfile( "./images", "button_template.png", $wgUploadDirectory ); 00110 copyfile( "./images", "magnify-clip.png", $wgUploadDirectory ); 00111 copyfile( "./images", "Arr_.png", $wgUploadDirectory ); 00112 copyfile( "./images", "Arr_r.png", $wgUploadDirectory ); 00113 copyfile( "./images", "Arr_d.png", $wgUploadDirectory ); 00114 copyfile( "./images", "Arr_l.png", $wgUploadDirectory ); 00115 00116 copyfile( "./languages", "Language.php", $IP ); 00117 copyfile( "./languages", "LanguageUtf8.php", $IP ); 00118 copyfile( "./languages", "Language" . ucfirst( $wgLanguageCode ) . ".php", $IP ); 00119 00120 if( !empty( $wgDebugLogFile ) ) { 00121 $fp = fopen( $wgDebugLogFile, "w" ); 00122 if ( false === $fp ) { 00123 print "Could not create log file \"{$wgDebugLogFile}\".\n"; 00124 exit(); 00125 } 00126 $d = date( "Y-m-d H:i:s" ); 00127 fwrite( $fp, "Wiki debug log file created {$d}\n\n" ); 00128 fclose( $fp ); 00129 } 00130 00131 if ( $wgUseTeX ) { 00132 copyfile( "./math", "texvc", "{$IP}/math", 0775 ); 00133 copyfile( "./math", "texvc_test", "{$IP}/math", 0775 ); 00134 copyfile( "./math", "texvc_tex", "{$IP}/math", 0775 ); 00135 } 00136 00137 copyfile( ".", "Version.php", $IP ); 00138 00139 print "ok\n"; 00140 } 00141 00142 ?>

Generated on Tue Jun 29 23:40:07 2004 for Mediawiki by doxygen 1.3.7