X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=install.php;h=435f6d63bf4ffe22f43045568b22cadc92ec0039;hb=5182cc686dacfcf64130b591a3b7ded8d4a0c9dc;hp=81241315e1f91987e012223a9a5b8c2fa6208913;hpb=83b09164573ede90d87a7038a56f651a5f82b9f1;p=quix0rs-gnu-social.git diff --git a/install.php b/install.php index 81241315e1..435f6d63bf 100644 --- a/install.php +++ b/install.php @@ -1,3 +1,4 @@ + * @author Tom Adams * @license GNU Affero General Public License http://www.gnu.org/licenses/ + * @version 0.9.x + * @link http://status.net */ define('INSTALLDIR', dirname(__FILE__)); @@ -90,6 +93,13 @@ $external_libraries=array( 'include'=>'HTTP/Request.php', 'check_class'=>'HTTP_Request' ), + array( + 'name'=>'HTTP_Request2', + 'pear'=>'HTTP_Request2', + 'url'=>'http://pear.php.net/package/HTTP_Request2', + 'include'=>'HTTP/Request2.php', + 'check_class'=>'HTTP_Request2' + ), array( 'name'=>'Mail', 'pear'=>'Mail', @@ -120,6 +130,14 @@ $external_libraries=array( 'include'=>'Net/URL/Mapper.php', 'check_class'=>'Net_URL_Mapper' ), + array( + 'name'=>'Net_LDAP2', + 'pear'=>'Net_LDAP2', + 'url'=>'http://pear.php.net/package/Net_LDAP2', + 'deb'=>'php-net-ldap2', + 'include'=>'Net/LDAP2.php', + 'check_class'=>'Net_LDAP2' + ), array( 'name'=>'Net_Socket', 'pear'=>'Net_Socket', @@ -242,7 +260,7 @@ function main() */ function haveExternalLibrary($external_library) { - if (isset($external_library['include']) && ! @include_once $external_library['include'] ) { + if (isset($external_library['include']) && !haveIncludeFile($external_library['include'])) { return false; } if (isset($external_library['check_function']) && ! function_exists($external_library['check_function'])) { @@ -254,6 +272,15 @@ function haveExternalLibrary($external_library) return true; } +// Attempt to include a PHP file and report if it worked, while +// suppressing the annoying warning messages on failure. +function haveIncludeFile($filename) { + $old = error_reporting(error_reporting() & ~E_WARNING); + $ok = include_once($filename); + error_reporting($old); + return $ok; +} + /** * Check if all is ready for installation * @@ -274,7 +301,7 @@ function checkPrereqs() } $reqs = array('gd', 'curl', - 'xmlwriter', 'mbstring','tidy'); + 'xmlwriter', 'mbstring', 'xml', 'dom', 'simplexml'); foreach ($reqs as $req) { if (!checkExtension($req)) { @@ -326,12 +353,19 @@ function checkPrereqs() */ function checkExtension($name) { - if (!extension_loaded($name)) { - if (!@dl($name.'.so')) { - return false; + if (extension_loaded($name)) { + return true; + } elseif (function_exists('dl') && ini_get('enable_dl') && !ini_get('safe_mode')) { + // dl will throw a fatal error if it's disabled or we're in safe mode. + // More fun, it may not even exist under some SAPIs in 5.3.0 or later... + $soname = $name . '.' . PHP_SHLIB_SUFFIX; + if (PHP_SHLIB_SUFFIX == 'dll') { + $soname = "php_" . $soname; } + return @dl($soname); + } else { + return false; } - return true; } /** @@ -353,7 +387,7 @@ function showLibs() } echo<< -

Laconica comes bundled with a number of libraries required for the application to work. However, it is best that you use PEAR or you distribution to manage +

StatusNet comes bundled with a number of libraries required for the application to work. However, it is best that you use PEAR or you distribution to manage libraries instead, as they tend to provide security updates faster, and may offer improved performance.

On Debian based distributions, such as Ubuntu, use a package manager (such as "aptitude", "apt-get", and "synaptic") to install the package listed.

On RPM based distributions, such as Red Hat, Fedora, CentOS, Scientific Linux, Yellow Dog Linux and Oracle Enterprise Linux, use a package manager (such as "yum", "apt-rpm", and "up2date") to install the package listed.

@@ -365,7 +399,7 @@ E_O_T; foreach ($absent_libraries as $library) { echo '
  • '; if (isset($library['url'])) { - echo ''.htmlentities($library['name']).''; + echo ''.htmlentities($library['name']).''; } else { echo htmlentities($library['name']); } @@ -388,8 +422,8 @@ E_O_T; E_O_T; foreach ($present_libraries as $library) { echo '
  • '; - if ($library['url']) { - echo ''.htmlentities($library['name']).''; + if (isset($library['url'])) { + echo ''.htmlentities($library['name']).''; } else { echo htmlentities($library['name']); } @@ -420,7 +454,6 @@ function showForm()

    Enter your database connection information below to initialize the database.

    -

    Laconica bundles a number of libraries for ease of installation. You can see what bundled libraries you are using, versus what libraries are installed on your server.

    @@ -476,12 +509,7 @@ E_O_T; function updateStatus($status, $error=false) { - echo '$status
  • "; + echo '$status"; } function handlePost() @@ -678,9 +706,7 @@ function writeConf($sitename, $server, $path, $fancy, $db) // database "\$config['db']['database'] = '{$db['database']}';\n\n". ($db['type'] == 'pgsql' ? "\$config['db']['quote_identifiers'] = true;\n\n":''). - "\$config['db']['type'] = '{$db['type']}';\n\n". - - "?>"; + "\$config['db']['type'] = '{$db['type']}';\n\n"; // write configuration file out to install directory $res = file_put_contents(INSTALLDIR.'/config.php', $cfg);