* @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. * * @version 0.1.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) { $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; } } ?>