[pLog-svn] r473 - plog/trunk/class/plugin

oscar at devel.plogworld.net oscar at devel.plogworld.net
Sun Dec 12 22:27:56 GMT 2004


Author: oscar
Date: 2004-12-12 22:27:55 +0000 (Sun, 12 Dec 2004)
New Revision: 473

Modified:
   plog/trunk/class/plugin/pluginmanager.class.php
Log:
if the plugin folder is not empty, do not show an error message complaining that the result is 
not an array!


Modified: plog/trunk/class/plugin/pluginmanager.class.php
===================================================================
--- plog/trunk/class/plugin/pluginmanager.class.php	2004-12-12 22:18:19 UTC (rev 472)
+++ plog/trunk/class/plugin/pluginmanager.class.php	2004-12-12 22:27:55 UTC (rev 473)
@@ -223,7 +223,11 @@
 	{
 		$pluginList = Array();
 
-            foreach(Glob::glob($this->_pluginDir, "*") as $pluginFile ) {
+		$pluginFiles = Glob::glob( $this->_pluginDir, "*" );
+		if( !is_array( $pluginFiles ))
+			return $pluginList;
+
+            foreach( $pluginFiles as $pluginFile ) {
               if( File::isDir($pluginFile)) {
                   // build up the name of the file
 		  $pluginId = array_pop(explode("/", $pluginFile));
@@ -280,9 +284,11 @@
         function getPlugins()
         {
             foreach( $this->_pluginList as $name ) {
-                $this->_pluginInstances["$name"]->setBlogInfo( &$this->_blogInfo );
-                $this->_pluginInstances["$name"]->setUserInfo( &$this->_userInfo );
-                $this->_pluginInstances["$name"]->register();
+		if( $this->_pluginInstances["$name"] ) {
+	                $this->_pluginInstances["$name"]->setBlogInfo( &$this->_blogInfo );
+        	        $this->_pluginInstances["$name"]->setUserInfo( &$this->_userInfo );
+                	$this->_pluginInstances["$name"]->register();
+		}
             }
 
             return $this->_pluginInstances;




More information about the pLog-svn mailing list