[pLog-svn] r6141 - in plog/trunk/class: action/admin config controller misc

mark at devel.lifetype.net mark at devel.lifetype.net
Thu Jan 3 01:08:14 EST 2008


Author: mark
Date: 2008-01-03 01:08:13 -0500 (Thu, 03 Jan 2008)
New Revision: 6141

Modified:
   plog/trunk/class/action/admin/adminversioncheckaction.class.php
   plog/trunk/class/config/configfilestorage.class.php
   plog/trunk/class/controller/admincontroller.class.php
   plog/trunk/class/controller/blogcontroller.class.php
   plog/trunk/class/misc/installation.class.php
Log:
1. Revert some changes in 6071 & 6072, actually we want to keep the $config as local variable instead of global. It is not so good to add global declaration there.

2. Revert the change of 6112, it cause some problems in 2.0.

Modified: plog/trunk/class/action/admin/adminversioncheckaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminversioncheckaction.class.php	2008-01-02 20:16:44 UTC (rev 6140)
+++ plog/trunk/class/action/admin/adminversioncheckaction.class.php	2008-01-03 06:08:13 UTC (rev 6141)
@@ -26,7 +26,6 @@
 				
 				// load the file with the reference checksums, as generated by the development
 				// team prior to the release
-				global $data;
 				include( PLOG_CLASS_PATH."install/files.properties.php");
 				
 				// now check the reference data agains the current data. The default folders are

Modified: plog/trunk/class/config/configfilestorage.class.php
===================================================================
--- plog/trunk/class/config/configfilestorage.class.php	2008-01-02 20:16:44 UTC (rev 6140)
+++ plog/trunk/class/config/configfilestorage.class.php	2008-01-03 06:08:13 UTC (rev 6141)
@@ -52,12 +52,10 @@
          */
         function reload()
         {
-			
-						
-            if( File::isReadable( $this->_configFile )) {
-                    // Note: It is correct to not use lt_include() here
-                global $config;
+           if( File::isReadable( $this->_configFile )) {
+                // Note: It is correct to not use lt_include() here
                 include( $this->_configFile );
+
                 $this->_props = new Properties( $config );
                 $result = true;
             }
@@ -248,7 +246,10 @@
 
         function getValue( $key, $defaultValue = null )
         {
-        	$value = $this->_props->getValue( $key, $defaultValue );
+        	$value = $this->_props->getValue( $key );
+            if( $value == "" || $value == null )
+            	if(isset($defaultValue))
+                	$value = $defaultValue;
 
             return $value;
         }

Modified: plog/trunk/class/controller/admincontroller.class.php
===================================================================
--- plog/trunk/class/controller/admincontroller.class.php	2008-01-02 20:16:44 UTC (rev 6140)
+++ plog/trunk/class/controller/admincontroller.class.php	2008-01-03 06:08:13 UTC (rev 6141)
@@ -77,8 +77,6 @@
         function _loadActionMaps()
         {
             // NOTE: this is an acceptable use of include()
-			global $actions;
-
 			include( PLOG_CLASS_PATH."class/controller/admincontrollermap.properties.php" );
 
             return $actions;

Modified: plog/trunk/class/controller/blogcontroller.class.php
===================================================================
--- plog/trunk/class/controller/blogcontroller.class.php	2008-01-02 20:16:44 UTC (rev 6140)
+++ plog/trunk/class/controller/blogcontroller.class.php	2008-01-03 06:08:13 UTC (rev 6141)
@@ -69,8 +69,6 @@
         function _loadActionMaps()
         {
             // Note: this is an acceptable use of include()
-			global $actions;
-
 			include( PLOG_CLASS_PATH."class/controller/controllermap.properties.php" );
 
             return $actions;

Modified: plog/trunk/class/misc/installation.class.php
===================================================================
--- plog/trunk/class/misc/installation.class.php	2008-01-02 20:16:44 UTC (rev 6140)
+++ plog/trunk/class/misc/installation.class.php	2008-01-03 06:08:13 UTC (rev 6141)
@@ -3,7 +3,6 @@
 	{
 	    function check()
 	    {
-	    	global $config;
 	    	include_once( PLOG_CLASS_PATH."config/config.properties.php" );
 	
 		    if ( $config["db_host"] == '' || $config["db_username"] == '' || $config["db_database"] == '' ) {



More information about the pLog-svn mailing list