more dl/p margin tweaking, clear:both on catlinks
[mediawiki.git] / update.php
blob94dba69b76fe9914dc616cfb83a2d5c4ea89f8e1
1 <?php
3 die("obsolete; remove this file befor 1.3.0 release\n");
5 # Update already-installed software
8 include( "./install-utils.inc" );
9 require_once( "./maintenance/updaters.inc" );
10 install_version_checks();
12 if ( ! ( is_readable( "./LocalSettings.php" )
13 && is_readable( "./AdminSettings.php" ) ) ) {
14 print "A copy of your installation's LocalSettings.php\n" .
15 "and AdminSettings.php must exist in this source directory.\n";
16 exit();
19 $IP = "./includes";
20 require_once( "./LocalSettings.php" );
21 require_once( "./AdminSettings.php" );
23 include( "$IP/Version.php" );
25 if( $wgSitename == "MediaWiki" ) {
26 die( "You must set the site name in \$wgSitename before installation.\n\n" );
29 if ( $wgUseTeX && ( ! is_executable( "./math/texvc" ) ) ) {
30 print "To use math functions, you must first compile texvc by\n" .
31 "running \"make\" in the math directory.\n";
32 exit();
36 # Copy files into installation directories
38 do_update_files();
40 $wgDBuser = $wgDBadminuser;
41 $wgDBpassword = $wgDBadminpassword;
43 require_once( "{$IP}/Setup.php" );
44 require_once( "./maintenance/InitialiseMessages.inc" );
46 $wgTitle = Title::newFromText( "Update script" );
49 # Check the database for things that need to be fixed...
51 print "Checking database for necessary updates...\n";
53 $wgDatabase = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname,
54 1, false, true, false);
55 if ( !$wgDatabase->isOpen() ) {
56 print "Unable to connect to database: " . $wgDatabase->lastError() . "\n";
57 exit();
60 do_revision_updates();
62 do_ipblocks_update();
63 do_interwiki_update();
64 do_index_update();
65 do_linkscc_update();
66 do_linkscc_1_3_update();
67 do_hitcounter_update();
68 do_recentchanges_update();
69 do_user_real_name_update();
71 initialiseMessages();
73 $wgDatabase->close();
75 print "Done.\n";
76 exit();
82 function do_update_files() {
83 global $IP, $wgStyleSheetDirectory, $wgUploadDirectory, $wgLanguageCode, $wgDebugLogFile;
84 print "Copying files... ";
86 copyfile( ".", "LocalSettings.php", $IP );
87 copyfile( ".", "index.php", $IP );
88 copyfile( ".", "redirect.php", $IP );
89 # compatibility with older versions, can be removed in a year or so
90 # (written in Feb 2004)
91 copyfile( ".", "wiki.phtml", $IP );
92 copyfile( ".", "redirect.phtml", $IP );
94 copydirectory( "./includes", $IP );
95 copydirectory( "./stylesheets", $wgStyleSheetDirectory );
97 copyfile( "./images", "wiki.png", $wgUploadDirectory );
98 copyfile( "./images", "button_bold.png", $wgUploadDirectory );
99 copyfile( "./images", "button_extlink.png", $wgUploadDirectory );
100 copyfile( "./images", "button_headline.png", $wgUploadDirectory );
101 copyfile( "./images", "button_hr.png", $wgUploadDirectory );
102 copyfile( "./images", "button_image.png", $wgUploadDirectory );
103 copyfile( "./images", "button_italic.png", $wgUploadDirectory );
104 copyfile( "./images", "button_link.png", $wgUploadDirectory );
105 copyfile( "./images", "button_math.png", $wgUploadDirectory );
106 copyfile( "./images", "button_media.png", $wgUploadDirectory );
107 copyfile( "./images", "button_nowiki.png", $wgUploadDirectory );
108 copyfile( "./images", "button_sig.png", $wgUploadDirectory );
109 copyfile( "./images", "button_template.png", $wgUploadDirectory );
110 copyfile( "./images", "magnify-clip.png", $wgUploadDirectory );
111 copyfile( "./images", "Arr_.png", $wgUploadDirectory );
112 copyfile( "./images", "Arr_r.png", $wgUploadDirectory );
113 copyfile( "./images", "Arr_d.png", $wgUploadDirectory );
114 copyfile( "./images", "Arr_l.png", $wgUploadDirectory );
116 copyfile( "./languages", "Language.php", $IP );
117 copyfile( "./languages", "LanguageUtf8.php", $IP );
118 copyfile( "./languages", "Language" . ucfirst( $wgLanguageCode ) . ".php", $IP );
120 if( !empty( $wgDebugLogFile ) ) {
121 $fp = fopen( $wgDebugLogFile, "w" );
122 if ( false === $fp ) {
123 print "Could not create log file \"{$wgDebugLogFile}\".\n";
124 exit();
126 $d = date( "Y-m-d H:i:s" );
127 fwrite( $fp, "Wiki debug log file created {$d}\n\n" );
128 fclose( $fp );
131 if ( $wgUseTeX ) {
132 copyfile( "./math", "texvc", "{$IP}/math", 0775 );
133 copyfile( "./math", "texvc_test", "{$IP}/math", 0775 );
134 copyfile( "./math", "texvc_tex", "{$IP}/math", 0775 );
137 copyfile( ".", "Version.php", $IP );
139 print "ok\n";