]> git.mjollnir.org Git - s9y.git/commitdiff
Changes to make packaging s9y easier. Note that one no longer needs to set the seren...
authorjtate <jtate>
Sat, 17 Dec 2005 11:47:26 +0000 (11:47 +0000)
committerjtate <jtate>
Sat, 17 Dec 2005 11:47:26 +0000 (11:47 +0000)
include/admin/installer.inc.php
include/functions_installer.inc.php
serendipity_config.inc.php

index 6213c3729f865e6b81ecc01b9d10dc030cf2c023..84763ddec0ef24bed2634b8ba5a2a1836689ebcf 100644 (file)
@@ -316,11 +316,29 @@ if ( (int)$serendipity['GET']['step'] == 0 ) {
     <tr>
         <td><?php echo $basedir ?></td>
         <td width="200"><?php
+            $basewritable = False;
             if ( is_writable($basedir) ) {
                 echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+                $basewritable = True;
             } else {
-                echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
-                $showWritableNote = true;
+                #Figure out if we already have all we need
+                #PATH_SMARTY_COMPILE/
+                #uploads/
+                #archives/
+                #.htaccess
+                #serendipity_config_local.inc.php
+                # For completeness we could test to make sure the directories
+                # really are directories, but that's probably overkill
+                foreach (array('archives/', PATH_SMARTY_COMPILE . '/', 'uploads/', '.htaccess', 'serendipity_config_local.inc.php') as $path) {
+                    if (!is_writeable($basedir . $path)) {
+                        echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE . $path);
+                        $showWritableNote = true;
+                        break;
+                    }
+                }
+                if (!$showWritableNote) {
+                    echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+                }
             }
      ?></td>
     </tr>
@@ -330,8 +348,29 @@ if ( (int)$serendipity['GET']['step'] == 0 ) {
             if ( is_writable($basedir . PATH_SMARTY_COMPILE) ) {
                 echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
             } else {
-                echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
-                $showWritableNote = true;
+                if ($basewritable) {
+                    echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+                    #This directory will be created later in the process
+                } else {
+                    echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
+                    $showWritableNote = true;
+                }
+            }
+     ?></td>
+    </tr>
+    <tr>
+        <td><?php echo $basedir . 'archives/'?></td>
+        <td width="200"><?php
+            if ( is_writable($basedir . 'archives/') ) {
+                echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+            } else {
+                if ($basewritable) {
+                    echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+                    #This directory will be created later in the process
+                } else {
+                    echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
+                    $showWritableNote = true;
+                }
             }
      ?></td>
     </tr>
@@ -342,8 +381,13 @@ if ( (int)$serendipity['GET']['step'] == 0 ) {
             if ( is_writable($basedir . 'uploads/') ) {
                 echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
             } else {
-                echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
-                $showWritableNote = true;
+                if ($basewritable) {
+                    echo serendipity_installerResultDiagnose(S9Y_I_SUCCESS, WRITABLE);
+                    #This directory will be created later in the process
+                } else {
+                    echo serendipity_installerResultDiagnose(S9Y_I_ERROR, NOT_WRITABLE);
+                    $showWritableNote = true;
+                }
             }
      ?></td>
     </tr>
index 77eca9153b2b7608fe34f41f08eb0419a8da0c18..9ed4137eee8894c28f6ab2bd40e0874dcc04ef72 100644 (file)
@@ -630,9 +630,11 @@ function serendipity_checkInstallation() {
     if (!is_dir($_POST['serendipityPath'])) {
         $errs[] = sprintf(DIRECTORY_NON_EXISTANT, $_POST['serendipityPath']);
     }
+    /* This test has already been passed on the diagnosis page.  Besides 
+       it's a partially bogus test.
     elseif (!is_writable($_POST['serendipityPath']) ) {
         $errs[] = sprintf(DIRECTORY_WRITE_ERROR, $_POST['serendipityPath']);
-    }
+    }*/
     elseif (!is_dir($_POST['serendipityPath'] . $_POST['uploadPath'] ) && @mkdir($_POST['serendipityPath'] . $_POST['uploadPath'], $umask) !== true) {
         $errs[] = sprintf(DIRECTORY_CREATE_ERROR, $_POST['serendipityPath'] . $_POST['uploadPath']);
     }
@@ -643,7 +645,7 @@ function serendipity_checkInstallation() {
 
     // Attempt to create the template compile directory, it might already be there, but we just want to be sure
     if (!is_dir($_POST['serendipityPath'] . PATH_SMARTY_COMPILE) && @mkdir($_POST['serendipityPath'] . PATH_SMARTY_COMPILE, $umask) !== true) {
-        $errs[] = sprintf(DIRECTORY_CREATE_ERROR, $_POST['serendipityPath'] . PATH_ARCHIVES);
+        $errs[] = sprintf(DIRECTORY_CREATE_ERROR, $_POST['serendipityPath'] . PATH_SMARTY_COMPILE);
         $errs[] = sprintf(DIRECTORY_RUN_CMD     , 'mkdir'      , $_POST['serendipityPath'] . PATH_SMARTY_COMPILE);
         $errs[] = sprintf(DIRECTORY_RUN_CMD     , 'chmod go+rwx', $_POST['serendipityPath'] . PATH_SMARTY_COMPILE);
     } elseif (is_dir($_POST['serendipityPath'] . PATH_SMARTY_COMPILE) && !is_writeable($_POST['serendipityPath'] . PATH_SMARTY_COMPILE) && @chmod($_POST['serendipityPath'] . PATH_SMARTY_COMPILE, $umask) !== true) {
index 56d459e8ee5c00d336cc7faf6bc48f2e9fd0b408..90be1b7136477addf43821c31b98f8589c82e9b3 100644 (file)
@@ -12,7 +12,7 @@ if (!defined('S9Y_INCLUDE_PATH')) {
 define('S9Y_CONFIG_TEMPLATE',     S9Y_INCLUDE_PATH . 'include/tpl/config_local.inc.php');
 define('S9Y_CONFIG_USERTEMPLATE', S9Y_INCLUDE_PATH . 'include/tpl/config_personal.inc.php');
 
-define('IS_installed', file_exists('serendipity_config_local.inc.php'));
+define('IS_installed', file_exists('serendipity_config_local.inc.php') && (filesize('serendipity_config_local.inc.php') > 0));
 
 if (IS_installed === true && !defined('IN_serendipity')) {
     define('IN_serendipity', true);