/** * 构造函数 * * @param string $class_name 类名 */ public function __construct($class_name) { parent::__construct(); try { $context = KISS_Framework_Context::getInstance(); $context->mClassName = $this->_checkClass($class_name); $filter = KISS_Class::getClassConstant($context->mClassName, 'FILTERS'); $this->mFilters = $filter == '' ? array() : explode(',', $filter); $context->mFilters = $this->mFilters; $context->mCacheTime = intval(KISS_Class::getClassConstant($context->mClassName, 'CACHE_TIME')); } catch (Exception $error) { $page = new KISS_Page(); $page->showMessage($error->getMessage()); } }
/** * 构造函数 * * @param string $class_name 类名 */ public function __construct($class_name) { parent::__construct(); try { $context = KISS_Framework_Context::getInstance(); $context->mClassName = $class_name; $filter = KISS_Class::getClassConstant($context->mClassName, 'FILTERS'); $filters = $filter == '' ? array() : explode(',', $filter); } catch (Exception $error) { $page = new KISS_Page(); $page->showMessage($error->getMessage()); } while (count($filters) > 0) { $filter = array_shift($filters); $filter = new $filter(); $filter->doPreProcessing($context, $this); } }