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

oscar at devel.plogworld.net oscar at devel.plogworld.net
Mon Dec 13 23:40:38 GMT 2004


Author: oscar
Date: 2004-12-13 23:40:37 +0000 (Mon, 13 Dec 2004)
New Revision: 484

Modified:
   plog/trunk/class/controller/resourceclassloader.class.php
Log:
fixed a bug in the search engine

Modified: plog/trunk/class/controller/resourceclassloader.class.php
===================================================================
--- plog/trunk/class/controller/resourceclassloader.class.php	2004-12-13 22:49:10 UTC (rev 483)
+++ plog/trunk/class/controller/resourceclassloader.class.php	2004-12-13 23:40:37 UTC (rev 484)
@@ -34,22 +34,19 @@
 		 * @param path 
 		 * @return a ResourceClassLoader object
 		 */
-		function getLoader( $path = null )
+		function &getLoader( $path = null )
 		{
 			static $instance;
 
 			if( $instance == null ) {
-				if( $path == null )
-					$instance = new ResourceClassLoader( $path );
-				else
-					$instance = new ResourceClassLoader();
+				// create an instance if it does not exist yet...
+				$instance = new ResourceClassLoader();
 			}
-			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 );
-			}
+
+			// 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;
 		}
@@ -62,6 +59,8 @@
 		 */
 		function addSearchFolder( $folder )
 		{
+			$this->log->debug( "Adding new search folder: $folder" );
+		
 			$this->_paths[] = $folder;
 
 			return true;
@@ -93,13 +92,14 @@
 			//foreach( $this->_paths as $path ) {
 			$i = 0;
 			$loaded = false;
+			
 			while( ($i < count( $this->_paths )) && !$loaded ) {
 				// get the current folder
 				$path = $this->_paths[$i];
 				// build up the file name
-	                	$fileName = $path.strtolower($actionClassName).$this->_classFileSuffix;
+				$fileName = $path.strtolower($actionClassName).$this->_classFileSuffix;
 				// and see if it exists and can be loaded
-				print("file = $fileName<br/>");
+				print("trying to load file: $fileName<br/>");
 				if( File::exists( $fileName ) && File::isReadable( $fileName )) {
 					include_once( $fileName );
 					$loaded = true;




More information about the pLog-svn mailing list