From: jtate Date: Sat, 17 Dec 2005 11:47:26 +0000 (+0000) Subject: Changes to make packaging s9y easier. Note that one no longer needs to set the seren... X-Git-Tag: 1.0~224 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=631cf8a714033654c12f20c6b3bd54a85edf610f;p=s9y.git Changes to make packaging s9y easier. Note that one no longer needs to set the serendipity directory to be world writeable (or even writeable by the web server) to install anymore. Just create the archives/, uploads/ and templates_c/ folders and blank .htaccess and serendipity_config_local.inc.php files such that they are writeable by the apache process, and you will be able to install. --- diff --git a/include/admin/installer.inc.php b/include/admin/installer.inc.php index 6213c37..84763dd 100644 --- a/include/admin/installer.inc.php +++ b/include/admin/installer.inc.php @@ -316,11 +316,29 @@ if ( (int)$serendipity['GET']['step'] == 0 ) { @@ -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; + } + } + ?> + + + + @@ -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; + } } ?> diff --git a/include/functions_installer.inc.php b/include/functions_installer.inc.php index 77eca91..9ed4137 100644 --- a/include/functions_installer.inc.php +++ b/include/functions_installer.inc.php @@ -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) { diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php index 56d459e..90be1b7 100644 --- a/serendipity_config.inc.php +++ b/serendipity_config.inc.php @@ -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);