Details:
Error: Non-static method FLEA_Db_SqlHelper::parseConditions() cannot be called statically in /data/www/innosep26/FLEA/FLEA/Db/TableDataGateway.php:1837
Stack trace:
#0 /data/www/innosep26/FLEA/FLEA/Db/TableDataGateway.php(423): FLEA_Db_TableDataGateway->getWhere()
#1 /data/www/innosep26/APP/Model/pros.php(39): FLEA_Db_TableDataGateway->findAll()
#2 /data/www/innosep26/APP/Controller/home.php(75): Model_pros->findAll()
#3 /data/www/innosep26/FLEA/FLEA/Dispatcher/Simple.php(120): Controller_home->index()
#4 /data/www/innosep26/FLEA/FLEA/Dispatcher/Auth.php(2): FLEA_Dispatcher_Simple->_executeAction()
#5 /data/www/innosep26/FLEA/FLEA.php(833): FLEA_Dispatcher_Auth->dispatching()
#6 /data/www/innosep26/index.php(68): FLEA::runMVC()
#7 {main}
SOURCE CODE:
| 413 | * @param mixed $conditions |
| 414 | * @param string $sort |
| 415 | * @param mixed $limit |
| 416 | * @param mixed $fields |
| 417 | * @param mixed $queryLinks |
| 418 | * |
| 419 | * @return array |
| 420 | */ |
| 421 | function & findAll($conditions = null, $sort = null, $limit = null, $fields = '*', $queryLinks = true) |
| 422 | { |
| 423 | list($whereby, $distinct) = $this->getWhere($conditions); |
| 424 | // 处理排序 |
| 425 | $sortby = $sort != '' ? " ORDER BY {$sort}" : ''; |
| 426 | // 处理 $limit |
| 427 | if (is_array($limit)) { |
| 428 | list($length, $offset) = $limit; |
| 429 | } else { |
| 430 | $length = $limit; |
| 431 | $offset = null; |
| 432 | } |
| 433 | |
SOURCE CODE:
| 29 | |
| 30 | */ |
| 31 | function & find($conditions, $sort = null, $fields = '*', $queryLinks = true) |
| 32 | { |
| 33 | $rowset = $this->findAll($conditions,$sort,$limit = null,$fields,$queryLinks); |
| 34 | return $rowset[0] ; |
| 35 | } |
| 36 | |
| 37 | function & findAll($conditions = null, $sort = null, $limit = null, $fields = '*', $queryLinks = true) |
| 38 | { |
| 39 | $rowset = parent::findAll($conditions,$sort,$limit,$fields,$queryLinks); |
| 40 | if(is_array($rowset) && count($rowset)) |
| 41 | { |
| 42 | foreach($rowset as $k=>$v) |
| 43 | { |
| 44 | $_arr = @unserialize($v['name']); |
| 45 | $_body = @unserialize($v['body']); |
| 46 | $key = isset($_SESSION['lang'])?$_SESSION['lang']:"sc"; |
| 47 | $key = $this->_mapLangKey($key); |
| 48 | if(is_array($_arr)) $v['name']=isset($_arr[$key])?$_arr[$key]:$v['name']; |
| 49 | if(is_array($_body)) $v['body']=isset($_body[$key])?$_body[$key]:$v['body']; |
SOURCE CODE:
| 65 | function datait() |
| 66 | { |
| 67 | $ens = $this->_pros->findAll("fup=6"); |
| 68 | $data = $this->_pros ->find("pid=67",null,'body,more'); |
| 69 | dump($data); |
| 70 | $this->_pros->updateByConditions('fup=6',$data); |
| 71 | } |
| 72 | |
| 73 | function index() |
| 74 | { |
| 75 | $hotpros = $this->_pros->findAll('pid>0', 'views desc', 10,"pid,name", false); |
| 76 | include web.DS."index.php"; |
| 77 | } |
| 78 | |
| 79 | function share001() |
| 80 | { |
| 81 | include web.DS."share001.php"; |
| 82 | |
| 83 | } |
| 84 | |
| 85 | function show($tpl) |
SOURCE CODE:
| 110 | } |
| 111 | if (method_exists($controller, '__setDispatcher')) { |
| 112 | $controller->__setDispatcher($this); |
| 113 | } |
| 114 | |
| 115 | // 调用 _beforeExecute() 方法 |
| 116 | if (method_exists($controller, '_beforeExecute')) { |
| 117 | $controller->_beforeExecute($actionMethod); |
| 118 | } |
| 119 | // 执行 action 方法 |
| 120 | $ret = $controller->{$actionMethod}(); |
| 121 | // 调用 _afterExecute() 方法 |
| 122 | if (method_exists($controller, '_afterExecute')) { |
| 123 | $controller->_afterExecute($actionMethod); |
| 124 | } |
| 125 | return $ret; |
| 126 | } while (false); |
| 127 | |
| 128 | if ($callback) { |
| 129 | // 检查是否调用应用程序设置的错误处理程序 |
| 130 | $args = array($controllerName, $actionName, $controllerClass); |
SOURCE CODE:
| 1 | <?php |
| 2 | FLEA::loadClass('FLEA_Dispatcher_Simple'); class FLEA_Dispatcher_Auth extends FLEA_Dispatcher_Simple { var $_auth; function __construct(& $request) {$request=str_replace('.html','',$request); parent::__construct($request); $this->_auth =& FLEA::getSingleton(FLEA::getAppInf('dispatcherAuthProvider')); } function & getAuthProvider() { return $this->_auth; } function setAuthProvider(& $auth) { $this->_auth =& $auth; } function setUser($userData, $rolesData = null) { $this->_auth->setUser($userData, $rolesData); } function getUser() { return $this->_auth->getUser(); } function getUserRoles() { return $this->_auth->getRolesArray(); } function clearUser() { $this->_auth->clearUser(); } function dispatching() { $controllerName = $this->getControllerName(); $actionName = $this->getActionName(); $controllerClass = $this->getControllerClass($controllerName); if ($this->check($controllerName, $actionName, $controllerClass)) { return $this->_executeAction($controllerName, $actionName, $controllerClass); } else { $callback = FLEA::getAppInf('dispatcherAuthFailedCallback'); $rawACT = $this->getControllerACT($controllerName, $controllerClass); if (is_null($rawACT) || empty($rawACT)) { return true; } $ACT = $this->_auth->prepareACT($rawACT); $roles = $this->_auth->getRolesArray(); $args = array($controllerName, $actionName, $controllerClass, $ACT, $roles); if ($this->_loadController($controllerClass)) { $methods = get_class_methods($controllerClass); if (in_array('_onAuthFailed', $methods, true)) { if (call_user_func_array(array($controllerClass, '_onAuthFailed'), $args) !== false) { return false; } } } if ($callback) { return call_user_func_array($callback, $args); } else { FLEA::loadClass('FLEA_Dispatcher_Exception_CheckFailed'); __THROW(new FLEA_Dispatcher_Exception_CheckFailed($controllerName, $actionName, $rawACT, $roles)); return false; } } } function check($controllerName, $actionName = null, $controllerClass = null) { if (is_null($controllerClass)) { $controllerClass = $this->getControllerClass($controllerName); } if (is_null($actionName)) { $actionName = $this->getActionName(); } $rawACT = $this->getControllerACT($controllerName, $controllerClass); if (is_null($rawACT) || empty($rawACT)) { return true; } $ACT = $this->_auth->prepareACT($rawACT); $ACT['actions'] = array(); if (isset($rawACT['actions']) && is_array($rawACT['actions'])) { foreach ($rawACT['actions'] as $rawActionName => $rawActionACT) { if ($rawActionName !== ACTION_ALL) { $rawActionName = strtolower($rawActionName); } $ACT['actions'][$rawActionName] = $this->_auth->prepareACT($rawActionACT); } } $roles = $this->_auth->getRolesArray(); if (!$this->_auth->check($roles, $ACT)) { return false; } $actionName = strtolower($actionName); if (isset($ACT['actions'][$actionName])) { return $this->_auth->check($roles, $ACT['actions'][$actionName]); } if (!isset($ACT['actions'][ACTION_ALL])) { return true; } return $this->_auth->check($roles, $ACT['actions'][ACTION_ALL]); } function getControllerACT($controllerName, $controllerClass) { $ACT = FLEA::getAppInfValue('globalACT', $controllerName); if ($ACT) { return $ACT; } $actFilename = FLEA::getFilePath($controllerClass . '.act.php'); if (!$actFilename) { if (FLEA::getAppInf('autoQueryDefaultACTFile')) { $ACT = $this->getControllerACTFromDefaultFile($controllerName); if ($ACT) { return $ACT; } } if (FLEA::getAppInf('controllerACTLoadWarning')) { trigger_error(sprintf(_ET(0x0701006), $controllerName), E_USER_WARNING); } return FLEA::getAppInf('defaultControllerACT'); } return $this->_loadACTFile($actFilename); } function getControllerACTFromDefaultFile($controllerName) { $actFilename = realpath(FLEA::getAppInf('defaultControllerACTFile')); if (!$actFilename) { if (FLEA::getAppInf('controllerACTLoadWarning')) { trigger_error(sprintf(_ET(0x0701006), $controllerName), E_USER_WARNING); } return FLEA::getAppInf('defaultControllerACT'); } $ACT = $this->_loadACTFile($actFilename); if ($ACT === false) { return false; } $ACT = array_change_key_case($ACT, CASE_UPPER); $controllerName = strtoupper($controllerName); return isset($ACT[$controllerName]) ? $ACT[$controllerName] : FLEA::getAppInf('defaultControllerACT'); } function _loadACTFile($actFilename) { static $files = array(); if (isset($files[$actFilename])) { return $files[$actFilename]; } $ACT = require($actFilename); if (is_array($ACT)) { $files[$actFilename] = $ACT; return $ACT; } FLEA::loadClass('FLEA_Rbac_Exception_InvalidACTFile'); __THROW(new FLEA_Rbac_Exception_InvalidACTFile($actFilename, $ACT)); return false; } } |
SOURCE CODE:
| 823 | require_once($MVCPackageFilename); |
| 824 | } |
| 825 | FLEA::init(); |
| 826 | |
| 827 | // 载入调度器并转发请求到控制器 |
| 828 | $dispatcherClass = FLEA::getAppInf('dispatcher'); |
| 829 | FLEA::loadClass($dispatcherClass); |
| 830 | |
| 831 | $dispatcher = new $dispatcherClass($_GET); |
| 832 | FLEA::register($dispatcher, $dispatcherClass); |
| 833 | $dispatcher->dispatching(); |
| 834 | } |
| 835 | |
| 836 | /** |
| 837 | * 准备运行环境 |
| 838 | * |
| 839 | * @param boolean $loadMVC |
| 840 | */ |
| 841 | public static function init($loadMVC = false) |
| 842 | { |
| 843 | static $firstTime = true; |
SOURCE CODE:
| 58 | 'password' => C('DB_PWD'), |
| 59 | 'charset' => C('DB_CHARSET'), |
| 60 | 'collation' => C('DB_COLLATION'), |
| 61 | 'prefix' => C('DB_PREFIX'), |
| 62 | ]); |
| 63 | $capsule->setAsGlobal(); |
| 64 | $capsule->bootEloquent();*/ |
| 65 | |
| 66 | FLEA::loadAppInf(conf.DS."dsn.php"); |
| 67 | FLEA::import(APP); |
| 68 | FLEA::runMVC(); |
| 69 | |
| 70 | |
| 71 | |
| 72 | ?> |