From: <gem...@li...> - 2013-01-10 17:22:21
|
Revision: 1094 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=1094&view=rev Author: matijsdejong Date: 2013-01-10 17:22:13 +0000 (Thu, 10 Jan 2013) Log Message: ----------- Do not check non-existing directories Modified Paths: -------------- trunk/library/classes/MUtil/Loader/PluginLoader.php Modified: trunk/library/classes/MUtil/Loader/PluginLoader.php =================================================================== --- trunk/library/classes/MUtil/Loader/PluginLoader.php 2013-01-10 17:08:49 UTC (rev 1093) +++ trunk/library/classes/MUtil/Loader/PluginLoader.php 2013-01-10 17:22:13 UTC (rev 1094) @@ -47,6 +47,26 @@ class MUtil_Loader_PluginLoader extends Zend_Loader_PluginLoader { /** + * Add prefixed paths to the registry of paths + * + * @param string $prefix + * @param string $path + * @return Zend_Loader_PluginLoader + */ + public function addPrefixPath($prefix, $path) + { + if (!is_string($prefix) || !is_string($path)) { + throw new Zend_Loader_PluginLoader_Exception('Zend_Loader_PluginLoader::addPrefixPath() method only takes strings for prefix and path.'); + } + + // Only add existing directories + if (file_exists(rtrim($path, '/\\'))) { + parent::addPrefixPath($prefix, $path); + } + + return $this; + } + /** * Instantiate a new class using the arguments array for initiation * * @param string $className This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |