3 # Update already-installed software
6 if ( ! ( is_readable( "./LocalSettings.php" )
7 && is_readable( "./AdminSettings.php" ) ) ) {
8 print "A copy of your installation's LocalSettings.php\n" .
9 "and AdminSettings.php must exist in this source directory.\n";
14 include_once( "./LocalSettings.php" );
15 include_once( "./AdminSettings.php" );
17 if ( $wgUseTeX && ( ! is_executable( "./math/texvc" ) ) ) {
18 print "To use math functions, you must first compile texvc by\n" .
19 "running \"make\" in the math directory.\n";
27 # Copy files into installation directories
29 print "Copying files...\n";
31 copyfile( ".", "wiki.phtml", $IP );
32 copyfile( ".", "redirect.phtml", $IP );
33 copyfile( ".", "texvc.phtml", $IP );
35 $handle = opendir( "./includes" );
36 while ( false !== ( $f = readdir( $handle ) ) ) {
37 if ( "." == $f{0} ) continue;
38 copyfile( "./includes", $f, $IP );
41 $handle = opendir( "./stylesheets" );
42 while ( false !== ( $f = readdir( $handle ) ) ) {
43 if ( "." == $f{0} ) continue;
44 copyfile( "./stylesheets", $f, $wgStyleSheetDirectory );
47 copyfile( "./images", "wiki.png", $wgUploadDirectory );
48 copyfile( "./languages", "Language.php", $IP );
49 copyfile( "./languages", "Language" . ucfirst( $wgLanguageCode ) . ".php", $IP );
51 $fp = fopen( $wgDebugLogFile, "w" );
52 if ( false === $fp ) {
53 print "Could not create log file \"{$wgDebugLogFile}\".\n";
56 $d = date( "Y-m-d H:i:s" );
57 fwrite( $fp, "Wiki debug log file created {$d}\n\n" );
61 copyfile( "./math", "texvc", "{$IP}/math", 0775 );
62 copyfile( "./math", "texvc_test", "{$IP}/math", 0775 );
63 copyfile( "./math", "texvc_tex", "{$IP}/math", 0775 );
66 print "Done.\nIf any database changes are necessary, you may have to run\n" .
67 "one or more \"patch\" files from the maintenance directory.\n";
70 function copyfile( $sdir, $name, $ddir, $perms = 0644 ) {
71 global $installOwner, $installGroup;
73 $d = "{$ddir}/{$name}";
74 if ( copy( "{$sdir}/{$name}", $d ) ) {
75 if ( isset( $installOwner ) ) { chown( $d, $installOwner ); }
76 if ( isset( $installGroup ) ) { chgrp( $d, $installGroup ); }
78 # print "Copied \"{$name}\" to \"{$ddir}\".\n";
80 print "Failed to copy file \"{$name}\" to \"{$ddir}\".\n";