/** * 检验是否有效 * * @param string $validator 如numeric可能会调用Plugin_Validator_Numeric或Leb_Validator_Numeric类 * @param string $arguments['value'] 值 * @param string $arguments['infoKey'] 从外部配置文件获得的键值 * @return int */ protected function _isValid($validator, $arguments) { $className = 'Leb_Validator_' . ucfirst($validator); if (!Leb_Loader::loadClass($className)) { $className = 'Plugin_Validator_' . ucfirst($validator); } if (class_exists($className)) { return call_user_func_array(array($className, 'isValid'), $arguments); } else { return true; } }
<?php /** * 程序入口(本地请求),后台定时任务使用 * * @category Leb * @package Leb_Bootstrap * @copyright * @license * php console.php index default admin */ require_once "config/init_console.php"; require_once 'framework/loader.php'; Leb_Loader::setAutoload(); $controller = Leb_Controller::getInstance(true); $controller->run();
public static function app() { if (!self::$_app) { self::$_app = _CLI_ ? new CmdApp() : new WebApp(); } return self::$_app; }