From 2371fe90922bec9ac212112e3a837f07edc61d5d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 27 Aug 2009 08:45:53 -0700 Subject: don't show a warning when dl() disabled --- install.php | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'install.php') diff --git a/install.php b/install.php index d278bcc17..24e85fe84 100644 --- a/install.php +++ b/install.php @@ -87,7 +87,7 @@ function checkPrereqs() function checkExtension($name) { if (!extension_loaded($name)) { - if (!dl($name.'.so')) { + if (!@dl($name.'.so')) { return false; } } @@ -129,7 +129,7 @@ function showForm()

Database hostname

  • - + MySQL
    PostgreSQL
    @@ -181,7 +181,7 @@ function handlePost() $fancy = !empty($_POST['fancy']); $server = $_SERVER['HTTP_HOST']; $path = substr(dirname($_SERVER['PHP_SELF']), 1); - + ?>
    Page notice
    @@ -219,7 +219,7 @@ function handlePost() showForm(); return; } - + switch($dbtype) { case 'mysql': $db = mysql_db_installer($host, $database, $username, $password); @@ -229,26 +229,26 @@ function handlePost() break; default: } - + if (!$db) { // database connection failed, do not move on to create config file. return false; } - + updateStatus("Writing config file..."); $res = writeConf($sitename, $server, $path, $fancy, $db); - + if (!$res) { updateStatus("Can't write config file.", true); showForm(); return; } - + /* TODO https needs to be considered */ $link = "http://".$server.'/'.$path; - + updateStatus("StatusNet has been installed at $link"); updateStatus("You can visit your new StatusNet site."); ?> @@ -266,7 +266,7 @@ function pgsql_db_installer($host, $database, $username, $password) { updateStatus("Starting installation..."); updateStatus("Checking database..."); $conn = pg_connect($connstring); - + if ($conn ===false) { updateStatus("Failed to connect to database: $connstring"); showForm(); @@ -285,7 +285,7 @@ function pgsql_db_installer($host, $database, $username, $password) { //wrap in transaction; pg_query($conn, 'BEGIN'); $res = runDbScript(INSTALLDIR.'/db/statusnet_pg.sql', $conn, 'pgsql'); - + if ($res === false) { updateStatus("Can't run database script.", true); showForm(); @@ -311,9 +311,9 @@ function pgsql_db_installer($host, $database, $username, $password) { else { $sqlUrl = "pgsql://$username:$password@$host/$database"; } - + $db = array('type' => 'pgsql', 'database' => $sqlUrl); - + return $db; } @@ -353,7 +353,7 @@ function mysql_db_installer($host, $database, $username, $password) { return false; } } - + $sqlUrl = "mysqli://$username:$password@$host/$database"; $db = array('type' => 'mysql', 'database' => $sqlUrl); return $db; @@ -364,22 +364,22 @@ function writeConf($sitename, $server, $path, $fancy, $db) // assemble configuration file in a string $cfg = ""; // write configuration file out to install directory $res = file_put_contents(INSTALLDIR.'/config.php', $cfg); -- cgit v1.2.3-54-g00ecf