[pLog-svn] r581 - plog/trunk/class/config

oscar at devel.plogworld.net oscar at devel.plogworld.net
Mon Dec 27 13:27:16 GMT 2004


Author: oscar
Date: 2004-12-27 13:27:15 +0000 (Mon, 27 Dec 2004)
New Revision: 581

Modified:
   plog/trunk/class/config/configfilestorage.class.php
Log:
made a few improvements to ConfigFileStorage::reload() so that we don't get annoying warning messages if the file is not readable or cannot be found


Modified: plog/trunk/class/config/configfilestorage.class.php
===================================================================
--- plog/trunk/class/config/configfilestorage.class.php	2004-12-26 12:29:22 UTC (rev 580)
+++ plog/trunk/class/config/configfilestorage.class.php	2004-12-27 13:27:15 UTC (rev 581)
@@ -44,15 +44,21 @@
         /**
          * Reloads the contents from the configuration file.
          *
-         * @return Returns always true.
+         * @return Returns true if successul or false otherwise
          */
         function reload()
         {
-        	include( $this->_configFile );
-
-            $this->_props = new Properties( $config );
-
-            return true;
+            if( File::isReadable( $this->_configFile )) {
+        	   include( $this->_configFile );
+        	   $this->_props = new Properties( $config );
+        	   $result = true;
+            }
+            else {
+                $this->_props = new Properties();
+                $result = false;
+            }
+            
+            return( $result );
         }
 
         /**




More information about the pLog-svn mailing list