* @license PHP License * @package WB * @subpackage base */ /** * Class includer: Pat * * pat* classes are stored in special folder structure, given that * they are housed in different subversion repositories. * * Actually, this class loaded is used very rarely, since pat*-classes implement * their own module loading facility. Used only on explicit call of WBClass::load('pat*'); * * @version 0.2.0 * @package WB * @subpackage base */ class WBClass_Loader_Pat extends WBClass_Loader { /** * Load named class * * @param string $clazz * @return bool true if class could be loaded */ public function load($clazz) { $clazz = substr($clazz, strlen($this->prefix)); // patErrorManager is part of package patError if ('ErrorManager' == $clazz) { $clazz = 'Error'; if (class_exists('patError', false)) { return true; } } $path = explode('_', $clazz, 2); foreach ($this->incDir as $dir) { // try to load from extension folder $file = $dir . '/patEx/' . str_replace('_', '/', $clazz) . '.php'; if (!file_exists($file)) { // try to load from original folder $file = $dir . '/pat' . $path[0] . '/pat' . str_replace('_', '/', $clazz) . '.php'; } if (!file_exists($file)) { continue; } include $file; // include ErrorManager as well if ('Error' == $clazz) { $file = $dir . '/patError/patErrorManager.php'; include $file; } return true; } return false; } }