[pLog-svn] r467 - plog/trunk/class/controller

oscar at devel.plogworld.net oscar at devel.plogworld.net
Fri Dec 10 15:26:49 GMT 2004


Author: oscar
Date: 2004-12-10 15:26:48 +0000 (Fri, 10 Dec 2004)
New Revision: 467

Modified:
   plog/trunk/class/controller/resourceclassloader.class.php
Log:
a couple of changes to ResourceClassLoader::getLoader()


Modified: plog/trunk/class/controller/resourceclassloader.class.php
===================================================================
--- plog/trunk/class/controller/resourceclassloader.class.php	2004-12-10 15:23:57 UTC (rev 466)
+++ plog/trunk/class/controller/resourceclassloader.class.php	2004-12-10 15:26:48 UTC (rev 467)
@@ -19,7 +19,7 @@
 		 * @param classFileSuffix default suffix that each class file will have
 		 * @static
 		 */
-		function ResourceClassLoader( $path = ".", $classFileSuffix = '.class.php' )
+		function ResourceClassLoader( $path = "./", $classFileSuffix = '.class.php' )
 		{
 			$this->Object();
 
@@ -34,15 +34,22 @@
 		 * @param path 
 		 * @return a ResourceClassLoader object
 		 */
-		function getLoader( $path = "./" )
+		function getLoader( $path = null )
 		{
 			static $instance;
 
 			if( $instance == null ) {
-				$instance = new ResourceClassLoader( $path );
+				if( $path == null )
+					$instance = new ResourceClassLoader( $path );
+				else
+					$instance = new ResourceClassLoader();
 			}
-			else
-				$instance->addSearchFolder( $path );
+			else {
+				// if a path is given and the object already exists, then
+				// we can also automatically add it to the list of searched folders...
+				if( $path != null )
+					$instance->addSearchFolder( $path );
+			}
 		
 			return $instance;
 		}




More information about the pLog-svn mailing list