Exception: FLEA_Db_Exception_SqlQuery
Message: SQL 错误消息: "Lost connection to MySQL server during query"
SQL 语句: "mysql_connect('122.224.99.37', 'root') failed!"
SQL 错误代码: "7335941".
Filename: /var/www/api/FLEA/FLEA.php [747]
#8 FLEA_Db_Driver_Mysql::connect()
ARGS:
Array
(
)
SOURCE CODE:
| 737 |
|
| 738 |
$driver = ucfirst(strtolower($dsn['driver']));
|
| 739 |
$className = 'FLEA_Db_Driver_' . $driver;
|
| 740 |
if ($driver == 'Mysql' || $driver == 'Mysqlt') {
|
| 741 |
require_once(FLEA_DIR . '/Db/Driver/Mysql.php');
|
| 742 |
} else {
|
| 743 |
FLEA::loadClass($className);
|
| 744 |
}
|
| 745 |
$dbo =& new $className($dsn);
|
| 746 |
/* @var $dbo FLEA_Db_Driver_Abstract */
|
| 747 |
$dbo->connect();
|
| 748 |
|
| 749 |
$GLOBALS[G_FLEA_VAR]['DBO'][$dsnid] =& $dbo;
|
| 750 |
return $GLOBALS[G_FLEA_VAR]['DBO'][$dsnid];
|
| 751 |
}
|
| 752 |
|
| 753 |
/**
|
| 754 |
* 分析 DSN 字符串或数组,返回包含 DSN 连接信息的数组,失败返回 false
|
| 755 |
*
|
| 756 |
* @param string|array $dsn
|
| 757 |
*
|
Filename: /var/www/api/FLEA/FLEA/Db/TableDataGateway.php [301]
#7 FLEA::getDBO()
ARGS:
Array
(
)
SOURCE CODE:
| 291 |
// 当 skipInit 为 true 时,不初始化表数据入口对象
|
| 292 |
if (isset($params['skipConnect']) && $params['skipConnect'] != false) {
|
| 293 |
return;
|
| 294 |
}
|
| 295 |
|
| 296 |
// 初始化数据访问对象
|
| 297 |
if (!isset($params['dbo'])) {
|
| 298 |
if (isset($params['dbDSN'])) {
|
| 299 |
$dbo =& FLEA::getDBO($params['dbDSN']);
|
| 300 |
} else {
|
| 301 |
$dbo =& FLEA::getDBO();
|
| 302 |
}
|
| 303 |
} else {
|
| 304 |
$dbo =& $params['dbo'];
|
| 305 |
}
|
| 306 |
$this->setDBO($dbo);
|
| 307 |
|
| 308 |
// 当 skipCreateLinks 不为 true 时,建立关联
|
| 309 |
if (!isset($params['skipCreateLinks']) || $params['skipCreateLinks'] == false) {
|
| 310 |
$this->relink();
|
| 311 |
}
|
Filename: /var/www/api/APP/Controller/Default.php [9]
#6 FLEA_Db_TableDataGateway::FLEA_Db_TableDataGateway()
ARGS:
Array
(
)
SOURCE CODE:
| 1 |
<?php
|
| 2 |
class Controller_Default extends FLEA_Controller_Action
|
| 3 |
{
|
| 4 |
//var $smarty=& $this->_getView();
|
| 5 |
function actionIndex() {
|
| 6 |
define(APIDIR,getcwd());
|
| 7 |
$api_id = $_REQUEST[api_id]?$_REQUEST[api_id]:$_REQUEST[id];
|
| 8 |
load_class('Table_Api');
|
| 9 |
$db_api = & new Table_Api();
|
| 10 |
$con = array("api_id"=>$api_id);
|
| 11 |
$api = $db_api->find($con);
|
| 12 |
$dir = APIDIR."/api/$api_id/";
|
| 13 |
if($api[lantype]==1)
|
| 14 |
{
|
| 15 |
$filename = $dir."js/config.js";
|
| 16 |
if(!is_file($filename))
|
| 17 |
die("api未通过验证或者文件出错!");
|
| 18 |
require($filename);
|
| 19 |
exit();
|
Filename: /var/www/api/FLEA/FLEA/Dispatcher/Simple.php [120]
#5 Controller_Default::actionIndex()
ARGS:
Array
(
)
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 && !$noCallback) {
|
| 129 |
// 检查是否调用应用程序设置的错误处理程序
|
| 130 |
$args = array($controllerName, $actionName, $controllerClass);
|
Filename: /var/www/api/FLEA/FLEA/Dispatcher/Auth.php [127]
#4 FLEA_Dispatcher_Simple::_executeAction('default', 'index', 'Controller_Default')
ARGS:
Array
(
[0] => default
[1] => index
[2] => Controller_Default
)
SOURCE CODE:
| 117 |
* @return mixed
|
| 118 |
*/
|
| 119 |
function dispatching()
|
| 120 |
{
|
| 121 |
$controllerName = $this->getControllerName();
|
| 122 |
$actionName = $this->getActionName();
|
| 123 |
$controllerClass = $this->getControllerClass($controllerName);
|
| 124 |
|
| 125 |
if ($this->check($controllerName, $actionName, $controllerClass)) {
|
| 126 |
// 检查通过,执行控制器方法
|
| 127 |
return $this->_executeAction($controllerName, $actionName, $controllerClass);
|
| 128 |
} else {
|
| 129 |
// 检查失败
|
| 130 |
$callback = FLEA::getAppInf('dispatcherAuthFailedCallback');
|
| 131 |
|
| 132 |
$rawACT = $this->getControllerACT($controllerName, $controllerClass);
|
| 133 |
if ($rawACT == null || empty($rawACT)) { return true; }
|
| 134 |
$ACT = $this->_auth->prepareACT($rawACT);
|
| 135 |
$roles = $this->_auth->getRolesArray();
|
| 136 |
$args = array($controllerName, $actionName, $controllerClass, $ACT, $roles);
|
| 137 |
|
Filename: /var/www/api/FLEA/FLEA.php [811]
#3 FLEA_Dispatcher_Auth::dispatching()
ARGS:
Array
(
)
SOURCE CODE:
| 801 |
require_once($MVCPackageFilename);
|
| 802 |
}
|
| 803 |
FLEA::init();
|
| 804 |
|
| 805 |
// 载入调度器并转发请求到控制器
|
| 806 |
$dispatcherClass = FLEA::getAppInf('dispatcher');
|
| 807 |
FLEA::loadClass($dispatcherClass);
|
| 808 |
|
| 809 |
$dispatcher =& new $dispatcherClass($_GET);
|
| 810 |
FLEA::register($dispatcher, $dispatcherClass);
|
| 811 |
$dispatcher->dispatching();
|
| 812 |
}
|
| 813 |
|
| 814 |
/**
|
| 815 |
* 准备运行环境
|
| 816 |
*
|
| 817 |
* @param boolean $loadMVC
|
| 818 |
*/
|
| 819 |
function init($loadMVC = false)
|
| 820 |
{
|
| 821 |
static $firstTime = true;
|
Filename: /var/www/api/FLEA/FLEA/Compatibility.php [263]
#2 FLEA::runMVC()
ARGS:
Array
(
)
SOURCE CODE:
| 253 |
FLEA::init();
|
| 254 |
}
|
| 255 |
|
| 256 |
/**
|
| 257 |
* FLEA 应用程序入口(已经过时,用 FLEA::runMVC() 代替)
|
| 258 |
*
|
| 259 |
* @deprecated
|
| 260 |
*/
|
| 261 |
function run()
|
| 262 |
{
|
| 263 |
FLEA::runMVC();
|
| 264 |
}
|
| 265 |
|
| 266 |
/**
|
| 267 |
* 初始化 Ajax,返回 FLEA_Ajax 对象实例(已经过时,用 FLEA::initAjax() 代替)
|
| 268 |
*
|
| 269 |
* @return FLEA_Ajax
|
| 270 |
* @deprecated
|
| 271 |
*/
|
| 272 |
function & init_ajax()
|
| 273 |
{
|
Filename: /var/www/api/index.php [13]
#1 run()
ARGS:
SOURCE CODE:
| 3 |
$dirname = dirname(__FILE__);
|
| 4 |
require('FLEA/FLEA.php');
|
| 5 |
import($dirname. '/APP');
|
| 6 |
register_app_inf($dirname."/APP/Config/MY_APP_INF.php");
|
| 7 |
require($dirname."/APP/Model/Json.php");
|
| 8 |
// set_app_inf('defaultController', 'Index');
|
| 9 |
set_app_inf('dispatcherAuthFailedCallback', 'retur');
|
| 10 |
function retur() {
|
| 11 |
die("您没有权限访问,请返回首页进行登入操作");
|
| 12 |
}
|
| 13 |
run();
|
| 14 |
?>
|