]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - install.php
* [Cc]an't -> [Cc]annot
[quix0rs-gnu-social.git] / install.php
index c2a5bb29ee394f392abe062ebf355f6d64b5fecc..78a4b8763695141e90738201f96ebc8c52c5a573 100644 (file)
@@ -1,3 +1,4 @@
+
 <?php
 /**
  * StatusNet - the distributed open-source microblogging tool
@@ -31,7 +32,7 @@
  * @author   Sarven Capadisli <csarven@status.net>
  * @author   Tom Adams <tom@holizz.com>
  * @license  GNU Affero General Public License http://www.gnu.org/licenses/
- * @version  0.9
+ * @version  0.9.x
  * @link     http://status.net
  */
 
@@ -92,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',
@@ -122,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',
@@ -340,13 +356,13 @@ function checkExtension($name)
     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);
+        // 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;
     }
@@ -371,11 +387,11 @@ function showLibs()
     }
     echo<<<E_O_T
     <div class="instructions">
-        <p>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
+        <p>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.</p>
         <p>On Debian based distributions, such as Ubuntu, use a package manager (such as &quot;aptitude&quot;, &quot;apt-get&quot;, and &quot;synaptic&quot;) to install the package listed.</p>
         <p>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 &quot;yum&quot;, &quot;apt-rpm&quot;, and &quot;up2date&quot;) to install the package listed.</p>
-        <p>On servers without a package manager (such as Windows), or if the library is not packaged for your distribution, you can use PHP's PEAR to install the library. Simply run &quot;pear install &lt;name&gt;&quot;.</p>
+        <p>On servers without a package manager (such as Windows), or if the library is not packaged for your distribution, you can use PHP PEAR to install the library. Simply run &quot;pear install &lt;name&gt;&quot;.</p>
     </div>
     <h2>Absent Libraries</h2>
     <ul id="absent_libraries">
@@ -383,7 +399,7 @@ E_O_T;
     foreach ($absent_libraries as $library) {
         echo '<li>';
         if (isset($library['url'])) {
-            echo '<a href=">'.$library['url'].'">'.htmlentities($library['name']).'</a>';
+            echo '<a href="'.$library['url'].'">'.htmlentities($library['name']).'</a>';
         } else {
             echo htmlentities($library['name']);
         }
@@ -407,7 +423,7 @@ E_O_T;
     foreach ($present_libraries as $library) {
         echo '<li>';
         if (isset($library['url'])) {
-            echo '<a href=">'.$library['url'].'">'.htmlentities($library['name']).'</a>';
+            echo '<a href="'.$library['url'].'">'.htmlentities($library['name']).'</a>';
         } else {
             echo htmlentities($library['name']);
         }
@@ -438,7 +454,7 @@ function showForm()
     <dd>
         <div class="instructions">
             <p>Enter your database connection information below to initialize the database.</p>
-            <p>Laconica bundles a number of libraries for ease of installation. <a href="?checklibs=true">You can see what bundled libraries you are using, versus what libraries are installed on your server.</a>
+            <p>StatusNet bundles a number of libraries for ease of installation. <a href="?checklibs=true">You can see what bundled libraries you are using, versus what libraries are installed on your server.</a>
         </div>
     </dd>
 </dl>
@@ -554,7 +570,7 @@ STR;
     $res = writeConf($sitename, $server, $path, $fancy, $db);
 
     if (!$res) {
-        updateStatus("Can't write config file.", true);
+        updateStatus("Cannot write config file.", true);
         showForm();
         return;
     }
@@ -600,7 +616,7 @@ function Pgsql_Db_installer($host, $database, $username, $password)
     $res = runDbScript(INSTALLDIR.'/db/statusnet_pg.sql', $conn, 'pgsql');
 
     if ($res === false) {
-        updateStatus("Can't run database script.", true);
+        updateStatus("Cannot run database script.", true);
         showForm();
         return false;
     }
@@ -611,7 +627,7 @@ function Pgsql_Db_installer($host, $database, $username, $password)
         updateStatus(sprintf("Adding %s data to database...", $name));
         $res = runDbScript(INSTALLDIR.'/db/'.$scr.'.sql', $conn, 'pgsql');
         if ($res === false) {
-            updateStatus(sprintf("Can't run %d script.", $name), true);
+            updateStatus(sprintf("Cannot run %d script.", $name), true);
             showForm();
             return false;
         }
@@ -636,21 +652,21 @@ function Mysql_Db_installer($host, $database, $username, $password)
 
     $conn = mysql_connect($host, $username, $password);
     if (!$conn) {
-        updateStatus("Can't connect to server '$host' as '$username'.", true);
+        updateStatus("Cannot connect to server '$host' as '$username'.", true);
         showForm();
         return false;
     }
     updateStatus("Changing to database...");
     $res = mysql_select_db($database, $conn);
     if (!$res) {
-        updateStatus("Can't change to database.", true);
+        updateStatus("Cannot change to database.", true);
         showForm();
         return false;
     }
     updateStatus("Running database script...");
     $res = runDbScript(INSTALLDIR.'/db/statusnet.sql', $conn);
     if ($res === false) {
-        updateStatus("Can't run database script.", true);
+        updateStatus("Cannot run database script.", true);
         showForm();
         return false;
     }
@@ -661,7 +677,7 @@ function Mysql_Db_installer($host, $database, $username, $password)
         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);
+            updateStatus(sprintf("Cannot run %d script.", $name), true);
             showForm();
             return false;
         }
@@ -691,9 +707,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);