From 94466da35afcb0b1680a478964b58fbc7970f4ec Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Tue, 15 Sep 2009 16:31:09 -0700 Subject: Got rid of a bunch of ugly warnings --- install.php | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'install.php') diff --git a/install.php b/install.php index 07a7bfaaf..a8f1ef4e2 100644 --- a/install.php +++ b/install.php @@ -1,5 +1,5 @@ . - * + * * @category Installation * @package Installation - * + * * @author Adrian Lang * @author Brenda Wallace * @author Brett Taylor @@ -33,7 +33,7 @@ * @author Tom Adams * @license GNU Affero General Public License http://www.gnu.org/licenses/ */ - + define('INSTALLDIR', dirname(__FILE__)); $external_libraries=array( @@ -211,10 +211,10 @@ $dbModules = array( ), ); -/** +/** * the actual installation. * If call libraries are present, then install - * + * * @return void */ function main() @@ -222,8 +222,8 @@ function main() if (!checkPrereqs()) { return; } - - if ($_GET['checklibs']) { + + if (!empty($_GET['checklibs'])) { showLibs(); } else { if ($_SERVER['REQUEST_METHOD'] == 'POST') { @@ -243,7 +243,7 @@ function main() */ function haveExternalLibrary($external_library) { - if (isset($external_library['include']) && ! include_once $external_library['include'] ) { + if (isset($external_library['include']) && ! @include_once $external_library['include'] ) { return false; } if (isset($external_library['check_function']) && ! function_exists($external_library['check_function'])) { @@ -282,7 +282,7 @@ function checkPrereqs() printf('

Cannot load required extension: %s

', $req); $pass = false; } - } + } // Make sure we have at least one database module available global $dbModules; $missingExtensions = array(); @@ -291,13 +291,13 @@ function checkPrereqs() $missingExtensions[] = $info['check_module']; } } - + if (count($missingExtensions) == count($dbModules)) { $req = implode(', ', $missingExtensions); - printf('

Cannot find mysql or pgsql extension. You need one or the other: %s

', $req); + printf('

Cannot find mysql or pgsql extension. You need one or the other.'); $pass = false; } - + if (!is_writable(INSTALLDIR)) { printf('

Cannot write config file to: %s

', INSTALLDIR); printf('

On your server, try this command: chmod a+w %s', INSTALLDIR); @@ -365,19 +365,19 @@ function showLibs() E_O_T; foreach ($absent_libraries as $library) { echo '

  • '; - if ($library['url']) { + if (isset($library['url'])) { echo ''.htmlentities($library['name']).''; } else { echo htmlentities($library['name']); } echo '
      '; - if ($library['deb']) { + if (isset($library['deb'])) { echo '
    • deb: ' . htmlentities($library['deb']) . '
    • '; } - if ($library['rpm']) { + if (isset($library['rpm'])) { echo '
    • rpm: ' . htmlentities($library['rpm']) . '
    • '; } - if ($library['pear']) { + if (isset($library['pear'])) { echo '
    • pear: ' . htmlentities($library['pear']) . '
    • '; } echo '
    '; @@ -552,7 +552,7 @@ STR; updateStatus("You can visit your new StatusNet site."); } -function Pgsql_Db_installer($host, $database, $username, $password) +function Pgsql_Db_installer($host, $database, $username, $password) { $connstring = "dbname=$database host=$host user=$username"; @@ -613,7 +613,7 @@ function Pgsql_Db_installer($host, $database, $username, $password) return $db; } -function Mysql_Db_installer($host, $database, $username, $password) +function Mysql_Db_installer($host, $database, $username, $password) { updateStatus("Starting installation..."); updateStatus("Checking database..."); @@ -690,7 +690,7 @@ function writeConf($sitename, $server, $path, $fancy, $db) * @param string $filename location of database schema file * @param dbconn $conn connection to database * @param string $type type of database, currently mysql or pgsql - * + * * @return boolean - indicating success or failure */ function runDbScript($filename, $conn, $type = 'mysqli') -- cgit v1.2.3-54-g00ecf