From d19c5c05d1a2b66347a4eeb1e21f02878c0cd1ed Mon Sep 17 00:00:00 2001 From: donncha Date: Sun, 14 Jan 2007 21:10:03 +0000 Subject: spaces -> tabs define VHOST during install. (fixes #216) git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@843 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- index-install.php | 444 +++++++++++++++++++++++++++--------------------------- 1 file changed, 218 insertions(+), 226 deletions(-) (limited to 'index-install.php') diff --git a/index-install.php b/index-install.php index 612d359..f9979fc 100644 --- a/index-install.php +++ b/index-install.php @@ -70,170 +70,162 @@ text-align: center; border-top: 1px solid #ccc; padding-top: 1em; font-style: it } function check_writeable_dir( $dir, $ret ) { - if( is_writeable( $dir ) == false ) { - print $dir." : FAILED
Quick Fix: chmod 777 $dir
"; - return false; - } else { - if( $ret == true ) { - return true; - } else { - return false; - } - } + if( is_writeable( $dir ) == false ) { + print $dir." : FAILED
Quick Fix: chmod 777 $dir
"; + return false; + } else { + if( $ret == true ) { + return true; + } else { + return false; + } + } } function filestats( $err ) { - print "

Server Summary

"; - print "

If you post a message to the MU support forum at http://mu.wordpress.org/forums/ then copy and paste the following information into your message:

"; - - print "
"; - print "
ERROR: $err
"; - clearstatcache(); - $files = array( "htaccess.dist", ".htaccess" ); - while( list( $key, $val ) = each( $files ) ) { - $stats = @stat( $val ); - if( $stats ) { - print "

$val

"; - print "    uid/gid: " . $stats[ 'uid' ] . "/" . $stats[ 'gid' ] . "
\n"; - print "    size: " . $stats[ 'size' ] . "
"; - print "    perms: " . substr( sprintf('%o', fileperms( $val ) ), -4 ) . "
"; - print "    readable: "; - print is_readable( $val ) == true ? "yes" : "no"; - print "
"; - print "    writeable: "; - print is_writeable( $val ) == true ? "yes" : "no"; - print "
"; - - } elseif( file_exists( $val ) == false ) { - print "

$val

"; - print "    FILE NOT FOUND: $val
"; + print "

Server Summary

"; + print "

If you post a message to the MU support forum at http://mu.wordpress.org/forums/ then copy and paste the following information into your message:

"; + + print "
"; + print "
ERROR: $err
"; + clearstatcache(); + $files = array( "htaccess.dist", ".htaccess" ); + while( list( $key, $val ) = each( $files ) ) { + $stats = @stat( $val ); + if( $stats ) { + print "

$val

"; + print "    uid/gid: " . $stats[ 'uid' ] . "/" . $stats[ 'gid' ] . "
\n"; + print "    size: " . $stats[ 'size' ] . "
"; + print "    perms: " . substr( sprintf('%o', fileperms( $val ) ), -4 ) . "
"; + print "    readable: "; + print is_readable( $val ) == true ? "yes" : "no"; + print "
"; + print "    writeable: "; + print is_writeable( $val ) == true ? "yes" : "no"; + print "
"; + } elseif( file_exists( $val ) == false ) { + print "

$val

"; + print "    FILE NOT FOUND: $val
"; + } } - } - print "
"; - + print "
"; } -function do_htaccess( $oldfilename, $newfilename, $base, $url ) -{ - // remove ending slash from $base and $url - $htaccess = ''; - if( substr($base, -1 ) == '/') { - $base = substr($base, 0, -1); - } - - if( substr($url, -1 ) == '/') { - $url = substr($url, 0, -1); - } - $err = ''; - if( is_file( $oldfilename ) ) { - $fp = @fopen( $oldfilename, "r" ); - if( $fp ) { - while( !feof( $fp ) ) - { - $htaccess .= fgets( $fp, 4096 ); - } - fclose( $fp ); - $htaccess = str_replace( "BASE", $base, $htaccess ); - if( touch( $newfilename ) ) { - $fp = fopen( $newfilename, "w" ); - if( $fp ) { - fwrite( $fp, $htaccess ); - fclose( $fp ); - } else { - $err = "could not open $newfilename for writing"; - } - } else { - $err = "could not open $newfilename for writing"; - } - } else { - $err = "could not open $oldfilename for reading"; +function do_htaccess( $oldfilename, $newfilename, $base, $url ) { + // remove ending slash from $base and $url + $htaccess = ''; + if( substr($base, -1 ) == '/') { + $base = substr($base, 0, -1); } - } else { - $err = "$oldfilename not found"; - } - - if( $err != '' ) { - print "

Warning!

"; - print "

There was a problem creating the .htaccess file.

"; - print "

Error: "; - if( $err == "could not open $newfilename for writing" ) { - print "Could Not Write To $newfilename."; - } elseif( $err == "could not open $oldfilename for reading" ) { - print "I could not read from $oldfilename. "; - } elseif( $err == "$oldfilename not found" ) { - print "The file, $oldfilename, is missing."; - } - print "

"; - filestats( $err ); - - print "

Please ensure that the webserver can write to this directory.

"; - print "

If you use Cpanel then read this post. Cpanel creates files that I need to overwrite and you have to fix that.

"; - print "

If all else fails then you'll have to create it by hand:"; - print "