Update of /cvsroot/php-blog/serendipity/include/admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19683/include/admin
Added Files:
configuration.inc.php
Removed Files:
installer.inc.php
Log Message:
- Rename installer.inc.php to configuration.inc.php
installer.inc.php will be replaced with something else... soon :)
--- installer.inc.php DELETED ---
--- NEW FILE: configuration.inc.php ---
<?php # $Id: configuration.inc.php,v 1.1 2004/12/03 16:16:44 tomsommer Exp $
umask(0000);
$umask = 0775;
@define('IN_installer', true);
if (!isset($_POST['installAction'])) {
$_POST['installAction'] = '';
}
/* Check where to deploy .htaccess files. For shared installation, first guess is submitted directory name.
If that is not existant we autodetect using current directory. */
if (IS_installed !== true) {
if (!empty($_POST['serendipityPath'])) {
$serendipity_core = $_POST['serendipityPath'];
} else {
$serendipity_core = serendipity_httpCoreDir();
}
} else {
$serendipity_core = $serendipity['serendipityPath'];
}
switch ($_POST['installAction']) {
case 'check':
/* If we already have serendipity installed, all we need to do is write the configuration again */
if (!defined('IN_serendipity') || IN_serendipity !== true) {
$res = serendipity_checkInstallation();
if (is_array($res)) {
echo DIAGNOSTIC_ERROR . '<br /><br />';
echo '<span class="serendipityAdminMsgError">- ' . implode('<br />', $res) . '</span><br /><br />';
serendipity_printConfigTemplate(serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE), $_POST, false, true);
die();
}
echo '<br />';
/* We are good to go, lets install databases etc. */
echo ATTEMPT_SETUP_DATABASE . "<br />";
$res = serendipity_installDatabase();
if ($res !== false) {
echo ' ' . DATABASE_DONE . '<br />';
} else {
echo '<span class="serendipityAdminMsgError">- ' . DATABASE_ALREADY_INSTALLED . '</span><br />';
}
/* Next are the files, .htaccess */
printf(ATTEMPT_WRITE_FILE, $serendipity_core . '.htaccess');
$res = serendipity_installFiles($serendipity_core);
if (is_array($res)) {
echo '<span class="serendipityAdminMsgError">- ' . implode('<br />', $res) . '</span><br /><br />';
die();
} else {
echo DONE . '<br />';
}
/* We are now installed */
define('IN_serendipity', true);
/* register default plugins */
$GLOBALS['serendipity']['dbPrefix'] = $_POST['dbPrefix'];
$GLOBALS['serendipity']['dbName'] = $_POST['dbName'];
$GLOBALS['serendipity']['serendipityHTTPPath'] = $_POST['serendipityHTTPPath'];
if (!isset($serendipity['lang'])) {
$serendipity['lang'] = 'en';
}
include_once S9Y_INCLUDE_PATH . 'include/plugin_api.inc.php';
serendipity_plugin_api::register_default_plugins();
printf(
SERENDIPITY_INSTALLED . '<br />',
'<p><strong>',
'</strong></p>',
$_POST['pass'],
$_POST['user'],
'<br /><br />',
$_POST['serendipityHTTPPath']
);
@session_destroy();
}
$oldRewrite = $serendipity['rewrite']; // We save the rewrite method, because we run a check after $serendipity has been updated
$res = serendipity_updateConfiguration();
if (is_array($res)) {
echo DIAGNOSTIC_ERROR;
echo '<span class="serendipityAdminMsgError">- ' . implode('<br />', $res) . '</span><br /><br />';
} else {
/* If we have new rewrite rules, then install them */
if (isset($_POST['rewrite']) && $serendipity['serendipityUserlevel'] >= USERLEVEL_ADMIN && $oldRewrite != $_POST['rewrite']) {
printf(ATTEMPT_WRITE_FILE, $serendipity_core . '.htaccess');
$res = serendipity_installFiles($serendipity_core);
if (is_array($res)) {
echo implode('<br />', $res);
} else {
echo DONE . '<br />';
}
}
echo '<br /><div class="serendipityAdminMsgSuccess">'. WRITTEN_N_SAVED .'</div>';
}
break;
default:
/* Is serendipity already installed= */
if (file_exists('./serendipity_config_local.inc.php')) {
$from = &$serendipity;
} else {
define('VERSION_REQUIRED', '4.2.1');
/* Do check for required PHP version */
if (version_compare(PHP_VERSION, VERSION_REQUIRED) == -1) {
echo '<br /><span class="serendipityAdminMsgError">WARNING!<br />You are using PHP version ' . PHP_VERSION . '! Serendipity requires version ' . VERSION_REQUIRED . '</span>';
}
$from = false;
}
$t = serendipity_parseTemplate(S9Y_CONFIG_TEMPLATE);
serendipity_printConfigTemplate($t, $from, false, true);
}
/* vim: set sts=4 ts=4 expandtab : */
?>
|