X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=install.php;h=87a99a650895b3774adc3b2e0c84cf401cb370fe;hb=b140bcdee4b1f4c8f2f34a89a9c5c51e7ecfe826;hp=fbfd5e4d119efe4cd628265edeb1d4a8a0782a21;hpb=07efccd7ef274f6d6f2b28781a87ec7271702a7f;p=quix0rs-gnu-social.git diff --git a/install.php b/install.php index fbfd5e4d11..87a99a6508 100644 --- a/install.php +++ b/install.php @@ -1,4 +1,22 @@ - +. + */ + define('INSTALLDIR', dirname(__FILE__)); function main() @@ -19,12 +37,12 @@ function checkPrereqs() { if (file_exists(INSTALLDIR.'/config.php')) { ?>
Config file "config.php" already exists.
- +Require PHP version 5 or greater.
+ ?>Require PHP version 5 or greater.
Cannot load required extension "= $req ?>".
+ ?>Cannot load required extension "".
Cannot write config file to "= INSTALLDIR ?>".
+ ?>Cannot write config file to "".
On your server, try this command:
-chmod a+w = INSTALLDIR ?>- +
chmod a+w+
Cannot write avatar directory "= INSTALLDIR ?>/avatar/".
+ ?>Cannot write avatar directory "/avatar/".
On your server, try this command:
-chmod a+w = INSTALLDIR ?>/avatar/+
chmod a+w /avatar/return false; } @@ -182,19 +200,17 @@ function handlePost() showForm(); return; } - updateStatus("Adding SMS carrier data to database..."); - $res = runDbScript(INSTALLDIR.'/db/sms_carrier.sql', $conn); - if ($res === false) { - updateStatus("Can't run SMS carrier script.", true); - showForm(); - return; - } - updateStatus("Adding notice source data to database..."); - $res = runDbScript(INSTALLDIR.'/db/notice_source.sql', $conn); - if ($res === false) { - updateStatus("Can't run notice source script.", true); - showForm(); - return; + foreach (array('sms_carrier' => 'SMS carrier', + 'notice_source' => 'notice source', + 'foreign_services' => 'foreign service') + as $scr => $name) { + updateStatus(sprintf("Adding %s data to database...", $name)); + $res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn); + if ($res === false) { + updateStatus(sprintf("Can't run %d script.", $name), true); + showForm(); + return; + } } updateStatus("Writing config file..."); $sqlUrl = "mysqli://$username:$password@$host/$database"; @@ -213,7 +229,7 @@ function handlePost() function writeConf($sitename, $sqlUrl) { $res = file_put_contents(INSTALLDIR.'/config.php', - "\n". + "