Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1:/tmp/cvs-serv1880
Modified Files:
serendipity_admin_installer.inc.php serendipity_config.inc.php
serendipity_lang.inc.php
Log Message:
* Debug cleanup (coding style)
* Rethinked language-logic. We now only try and guess the language if we havn't installed serendipity yet. We can't just include a temporary lang and overwrite it again. Because we use constants.
Index: serendipity_admin_installer.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_installer.inc.php,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- serendipity_admin_installer.inc.php 7 Sep 2003 22:03:13 -0000 1.38
+++ serendipity_admin_installer.inc.php 7 Sep 2003 22:16:00 -0000 1.39
@@ -463,18 +463,15 @@
session_destroy();
+ }
- /*
- If serendipity is already installed and we are only doing a reconfiguration
- */
+ $res = serendipity_updateConfiguration();
+ if ( is_array($res) ) {
+ echo DIAGNOSTIC_ERROR;
+ echo '<span style="color: #FF0000">- ' . implode('<br />', $res) . '</span><br /><br />';
+ } else {
+ echo WRITTEN_N_SAVED;
}
- $res = serendipity_updateConfiguration();
- if ( is_array($res) ) {
- echo DIAGNOSTIC_ERROR;
- echo '<span style="color: #FF0000">- ' . implode('<br />', $res) . '</span><br /><br />';
- } else {
- echo WRITTEN_N_SAVED;
- }
break;
Index: serendipity_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- serendipity_config.inc.php 7 Sep 2003 21:33:53 -0000 1.31
+++ serendipity_config.inc.php 7 Sep 2003 22:16:00 -0000 1.32
@@ -7,6 +7,8 @@
$serendipity['version'] = '0.3';
$serendipity['production'] = 1;
$serendipity['rewrite'] = true;
+$installed = file_exists($serendipity['serendipityPath'] .'serendipity_config_local.inc.php');
+
/* Load main language file */
include('serendipity_lang.inc.php');
@@ -21,7 +23,7 @@
$serendipity['serendipityPath'] = './';
}
-if (!file_exists("{$serendipity['serendipityPath']}serendipity_config_local.inc.php")) {
+if (!$installed) {
die(sprintf(SERENDIPITY_NOT_INSTALLED, 'serendipity_admin.php'));
}
Index: serendipity_lang.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_lang.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- serendipity_lang.inc.php 7 Sep 2003 21:41:00 -0000 1.3
+++ serendipity_lang.inc.php 7 Sep 2003 22:16:00 -0000 1.4
@@ -2,14 +2,13 @@
if (serendipity_LANG_LOADED !== true) {
-
// Try and include preferred language from configurated setting
- if ( @include_once('serendipity_lang_'. $serendipity['lang'] .'.inc.php') ) {
+ if ( @include('serendipity_lang_'. $serendipity['lang'] .'.inc.php') ) {
// Only here can we truely say the language is loaded
define('serendipity_LANG_LOADED', true);
- } else { /* -- Auto-Guess -- */
+ } elseif ( !$installed ) { /* -- Auto-Guess -- */
// If no config file is loaded, language includes are not available.
// Now include one. Try to auto-guess the language by looking up the HTTP_ACCEPT_LANGUAGE.
@@ -27,8 +26,10 @@
} //endif
- // Add fallback to english
- include_once('serendipity_lang_en.inc.php');
+ // Do fallback to english
+ if ( serendipity_LANG_LOADED === true || !$installed) {
+ include_once('serendipity_lang_en.inc.php');
+ }
}
/* vim: set sts=4 ts=4 expandtab : */
|