Update of /cvsroot/php-blog/serendipity/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13909/include
Modified Files:
functions_installer.inc.php
Log Message:
1. Move serendipity_ini_bool / ini_bytesize to a central function place.
Upgrader and others may need this, so this does not belong to the
Admin page.
2. Make upgrader check at least the file permissions. Future unification
with the diagnosis for the installer is recommended, I am waiting
for a proposal from Tom as he disliked mine. :)
3. Put in template notices. Upgrading users need to know about this
bc-breaking change of the author realname in -alpha12.
Index: functions_installer.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_installer.inc.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- functions_installer.inc.php 22 Feb 2005 10:10:03 -0000 1.39
+++ functions_installer.inc.php 27 Feb 2005 14:49:58 -0000 1.40
@@ -2,6 +2,29 @@
# Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
# All rights reserved. See LICENSE file for licensing details
+
+function serendipity_ini_bool($var) {
+ return ($var === 'on' || $var == '1');
+}
+
+function serendipity_ini_bytesize($val) {
+ if ( $val == '' )
+ return 0;
+
+ switch(substr($val, -1)) {
+ case 'k':
+ case 'K':
+ return (int) $val * 1024;
+ break;
+ case 'm':
+ case 'M':
+ return (int) $val * 1048576;
+ break;
+ default:
+ return $val;
+ }
+}
+
function serendipity_updateLocalConfig($dbName, $dbPrefix, $dbHost, $dbUser, $dbPass, $dbType, $dbPersistent, $privateVariables = null) {
global $serendipity;
umask(0000);
@@ -219,8 +242,8 @@
array(
date('H:i')
- ),
-
+ ),
+
$s);
}
@@ -488,7 +511,7 @@
// and have access to our's. So we randomize the SQLite dbname.
$_POST['sqlitedbName'] = $_POST['dbName'] . '_' . md5(time());
}
-
+
if (empty($_POST['dbPrefix']) && empty($serendipity['dbPrefix'])) {
$errs[] = sprintf(EMPTY_SETTING, INSTALL_DBPREFIX);
}
@@ -689,7 +712,7 @@
if ( !serendipity_checkConfigItemFlags($item, 'configuration') ) {
continue;
}
-
+
if (!isset($item['userlevel'])) {
$item['userlevel'] = USERLEVEL_ADMIN;
}
@@ -699,7 +722,7 @@
} else {
$authorid = $serendipity['authorid'];
}
-
+
serendipity_set_config_var($item['var'], $_POST[$item['var']], $authorid);
}
}
|