PHP面向切面编程组件(3)
来源:未知 责任编辑:责任编辑 发表时间:2014-03-23 22:26 点击:次
*/
public static function autoload() {
foreach(self::$_classes as $v){
require_once dirname(__FILE__) . $v;
}
}
/**
* 必须先调用此方法来实例化扩展族,才能调用addExtension\removeExtension等
* @return ExtensionFamily
*/
public static function createExtension(){
self::$extFamily = new ExtensionFamily();
return self::$extFamily;
}
public static function removeExtension($extName){
if(is_null(self::$extFamily)){
throw new Exception("Please createExtension first");
return false;
}else{
unset(self::$extFamily->_extensionArray[$extName]);
}
}
public static function addExtension($extName, Extension $ext){
if(is_null(self::$extFamily)){
throw new Exception("Please createExtension first");
return false;
}else{
self::$extFamily->_extensionArray[$extName] = $ext;
}
}
public static function removeAllExtension(){
if(is_null(self::$extFamily)){
throw new Exception("Please createExtension first");
return false;
}else{
foreach(self::$extFamily->_extensionArray as $extName=>$ext){
unset(self::$extFamily->_extensionArray[$extName]);
}
相关新闻>>
- 发表评论
-
- 最新评论 更多>>