Update of /cvsroot/php-blog/serendipity/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20063
Modified Files:
functions_config.inc.php functions_installer.inc.php
Log Message:
- Here be dragons and NO application logic!
- Add "probeDefault" flag, which will run $item['var'] through serendipity_probeInstallation() and set the returned value as $item['default']
Index: functions_config.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_config.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- functions_config.inc.php 6 Jan 2005 10:12:24 -0000 1.12
+++ functions_config.inc.php 17 Jan 2005 19:07:17 -0000 1.13
@@ -369,5 +369,39 @@
. '</iframe><br /><br />';
}
+function serendipity_probeInstallation($item) {
+ global $serendipity;
+ $res = NULL;
+
+ switch ( $item ) {
+ case 'dbType' :
+ $res = array();
+ if (extension_loaded('mysql')) {
+ $res['mysql'] = 'MySQL';
+ }
+ if (extension_loaded('postgres')) {
+ $res['postgres'] = 'PostgreSQL';
+ }
+ if (extension_loaded('mysqli')) {
+ $res['mysqli'] = 'MySQLi';
+ }
+ if (extension_loaded('sqlite')) {
+ $res['sqlite'] = 'SQLite';
+ }
+ break;
+
+ case 'rewrite' :
+ $res = array();
+ $res['none'] = 'Disable URL Rewriting';
+ $res['errordocs'] = 'Use Apache errorhandling';
+ if( in_array('mod_rewrite', apache_get_modules()) ) {
+ $res['rewrite'] = 'Use Apache mod_rewrite';
+ }
+ break;
+ }
+
+ return $res;
+}
+
/* vim: set sts=4 ts=4 expandtab : */
?>
Index: functions_installer.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/functions_installer.inc.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- functions_installer.inc.php 11 Jan 2005 13:00:44 -0000 1.27
+++ functions_installer.inc.php 17 Jan 2005 19:07:21 -0000 1.28
@@ -366,6 +366,11 @@
if (in_array('parseDescription', $item['flags'])) {
$item['description'] = serendipity_replaceEmbeddedConfigVars($item['description']);
}
+
+ if (in_array('probeDefault', $item['flags'])) {
+ $item['default'] = serendipity_probeInstallation($item['var']);
+ }
+
?>
<tr>
<td style="border-bottom: 1px #000000 solid" align="left" valign="top" width="75%">
|