Exception: flea_db_exception_sqlquery
Message: SQL 错误消息: "Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"
SQL 语句: "mysql_connect('localhost', 'hsj') failed!"
SQL 错误代码: "7335941".
Filename: /var/www/html/hsj/home/FLEA/FLEA/Db/Driver/Mysql.php
#9
flea_db_exception_sqlquery::flea_db_exception_sqlquery('mysql_connect('localhost', ...', 'Can't connect to local MySQ ...', 2002)
FILE: Mysql.php
LINE: 161
ARGS:
Array
(
[0] => mysql_connect('localhost', 'hsj') failed!
[1] => Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[2] => 2002
)
SOURCE CODE:
| 151 |
if (!isset($dsn['login'])) { $dsn['login'] = ''; }
|
| 152 |
if (!isset($dsn['password'])) { $dsn['password'] = ''; }
|
| 153 |
if (isset($dsn['options'])) {
|
| 154 |
$this->conn = mysql_connect($host, $dsn['login'], $dsn['password'], false, $dsn['options']);
|
| 155 |
} else {
|
| 156 |
$this->conn = mysql_connect($host, $dsn['login'], $dsn['password']);
|
| 157 |
}
|
| 158 |
|
| 159 |
if (!$this->conn) {
|
| 160 |
FLEA::loadClass('FLEA_Db_Exception_SqlQuery');
|
| 161 |
__THROW(new FLEA_Db_Exception_SqlQuery("mysql_connect('{$host}', '{$dsn['login']}') failed!", mysql_error(), mysql_errno()));
|
| 162 |
return false;
|
| 163 |
}
|
| 164 |
|
| 165 |
if (!mysql_select_db($dsn['database'], $this->conn)) {
|
| 166 |
FLEA::loadClass('FLEA_Db_Exception_SqlQuery');
|
| 167 |
__THROW(new FLEA_Db_Exception_SqlQuery("SELECT DATABASE: '{$dsn['database']}' FAILED!", mysql_error($this->conn), mysql_errno($this->conn)));
|
| 168 |
return false;
|
| 169 |
}
|
| 170 |
|
| 171 |
$version = $this->getOne('SELECT VERSION()');
|
Filename: /var/www/html/hsj/home/FLEA/FLEA.php
#8
flea_db_driver_mysql::connect()
FILE: FLEA.php
LINE: 559
ARGS:
Array
(
)
SOURCE CODE:
| 549 |
|
| 550 |
$driver = ucfirst(strtolower($dsn['driver']));
|
| 551 |
$className = 'FLEA_Db_Driver_' . $driver;
|
| 552 |
if ($driver == 'Mysql' || $driver == 'Mysqlt') {
|
| 553 |
require_once(FLEA_DIR . '/Db/Driver/Mysql.php');
|
| 554 |
} else {
|
| 555 |
FLEA::loadClass($className);
|
| 556 |
}
|
| 557 |
$dbo =& new $className($dsn);
|
| 558 |
/* @var $dbo FLEA_Db_Driver_Prototype */
|
| 559 |
$dbo->connect();
|
| 560 |
|
| 561 |
$GLOBALS[G_FLEA_VAR]['DBO'][$dsnid] =& $dbo;
|
| 562 |
return $GLOBALS[G_FLEA_VAR]['DBO'][$dsnid];
|
| 563 |
}
|
| 564 |
|
| 565 |
/**
|
| 566 |
* 分析 DSN 字符串或数组,返回包含 DSN 连接信息的数组,失败返回 false
|
| 567 |
*
|
| 568 |
* @param string|array $dsn
|
| 569 |
*
|
Filename: /var/www/html/hsj/home/FLEA/FLEA/Db/TableDataGateway.php
#7
flea::getdbo(array(5))
FILE: TableDataGateway.php
LINE: 277
ARGS:
Array
(
[0] => Array
(
[driver] => mysql
[host] => localhost
[login] => hsj
[password] => hsj@!@#$%^
[database] => hsjmain
)
)
SOURCE CODE:
| 267 |
// 当 skipInit 为 true 时,不初始化表数据入口对象
|
| 268 |
if (isset($params['skipConnect']) && $params['skipConnect'] != false) {
|
| 269 |
return;
|
| 270 |
}
|
| 271 |
|
| 272 |
// 初始化数据访问对象
|
| 273 |
if (!isset($params['dbo'])) {
|
| 274 |
if (isset($params['dbDSN'])) {
|
| 275 |
$dbo =& FLEA::getDBO($params['dbDSN']);
|
| 276 |
} else {
|
| 277 |
$dbo =& FLEA::getDBO(FLEA::getAppInf('dbDSN'));
|
| 278 |
}
|
| 279 |
} else {
|
| 280 |
$dbo =& $params['dbo'];
|
| 281 |
}
|
| 282 |
$this->setDBO($dbo);
|
| 283 |
|
| 284 |
// 当 skipCreateLinks 不为 true 时,建立关联
|
| 285 |
if (!isset($params['skipCreateLinks']) || $params['skipCreateLinks'] == false)
|
| 286 |
{
|
| 287 |
$this->relink();
|
Filename: /var/www/html/hsj/home/FLEA/FLEA.php
#6
model_products::flea_db_tabledatagateway()
FILE: FLEA.php
LINE: 318
ARGS:
Array
(
)
SOURCE CODE:
| 308 |
// 返回已经存在的对象实例
|
| 309 |
return FLEA::registry($className);
|
| 310 |
}
|
| 311 |
if (!class_exists($className)) {
|
| 312 |
if (!FLEA::loadClass($className)) {
|
| 313 |
$return = false;
|
| 314 |
return $return;
|
| 315 |
}
|
| 316 |
}
|
| 317 |
|
| 318 |
$instances[$className] =& new $className();
|
| 319 |
FLEA::register($instances[$className], $className);
|
| 320 |
return $instances[$className];
|
| 321 |
}
|
| 322 |
|
| 323 |
/**
|
| 324 |
* 将一个对象实例注册到对象实例容器
|
| 325 |
*
|
| 326 |
* @param object $obj
|
| 327 |
* @param string $name
|
| 328 |
*
|
Filename: /var/www/html/hsj/home/APP/Controller/product.php
#5
flea::getsingleton('Model_Products')
FILE: product.php
LINE: 14
ARGS:
Array
(
[0] => Model_Products
)
SOURCE CODE:
| 4 |
var $_modelProduct;
|
| 5 |
var $_modelProductCategory;
|
| 6 |
var $_modelProductModel;
|
| 7 |
var $_modelProductIndex;
|
| 8 |
var $_modelShop;
|
| 9 |
var $_modelpubProducts;
|
| 10 |
var $link_pub;
|
| 11 |
var $link_shop;
|
| 12 |
|
| 13 |
function Controller_product() {
|
| 14 |
$this->_modelProduct =& FLEA::getSingleton('Model_Products');
|
| 15 |
$this->_modelProductCategory =& FLEA::getSingleton('Model_ProductCategory');
|
| 16 |
$this->_modelMD =& FLEA::getSingleton('Model_ShopMD');
|
| 17 |
$this->_modelProductIndex =& FLEA::getSingleton('Model_ProductIndex');
|
| 18 |
$this->_modelpubProducts =& FLEA::getSingleton('Model_pubProducts');
|
| 19 |
$this->link_pub = array(
|
| 20 |
'tableClass' => 'Model_pubProducts',
|
| 21 |
'foreignKey' => 'product_id',
|
| 22 |
'mappingName' => 'product_info',
|
| 23 |
);
|
| 24 |
$this->link_shop = array(
|
Filename: /var/www/html/hsj/home/FLEA/FLEA/Dispatcher/Simple.php
#4
controller_product::controller_product('product')
FILE: Simple.php
LINE: 113
ARGS:
Array
(
[0] => product
)
SOURCE CODE:
| 103 |
if (!is_readable($controllerClassFilename)) {
|
| 104 |
$controllerClassFilename = null;
|
| 105 |
break;
|
| 106 |
}
|
| 107 |
require_once($controllerClassFilename);
|
| 108 |
if (!class_exists($controllerClass)) { break; }
|
| 109 |
|
| 110 |
// 构造控制器对象
|
| 111 |
FLEA::setAppInf('FLEA.internal.currentControllerName', $controllerName);
|
| 112 |
FLEA::setAppInf('FLEA.internal.currentActionName', $actionName);
|
| 113 |
$controller =& new $controllerClass($controllerName);
|
| 114 |
if (!method_exists($controller, $actionMethod)) { break; }
|
| 115 |
if (method_exists($controller, '__setController')) {
|
| 116 |
$controller->__setController($controllerName);
|
| 117 |
}
|
| 118 |
if (method_exists($controller, '__setDispatcher')) {
|
| 119 |
$controller->__setDispatcher($this);
|
| 120 |
}
|
| 121 |
|
| 122 |
// 调用 _beforeExecute() 方法
|
| 123 |
if (method_exists($controller, '_beforeExecute')) {
|
Filename: /var/www/html/hsj/home/FLEA/FLEA/Dispatcher/Simple.php
#3
flea_dispatcher_simple::_executeaction('product', 'show', 'Controller_product')
FILE: Simple.php
LINE: 77
ARGS:
Array
(
[0] => product
[1] => show
[2] => Controller_product
)
SOURCE CODE:
| 67 |
|
| 68 |
/**
|
| 69 |
* 从请求中分析 Controller、Action 和 Package 名字,然后执行指定的 Action 方法
|
| 70 |
*
|
| 71 |
* @return mixed
|
| 72 |
*/
|
| 73 |
function dispatching()
|
| 74 |
{
|
| 75 |
$controllerName = $this->getControllerName();
|
| 76 |
$actionName = $this->getActionName();
|
| 77 |
return $this->_executeAction($controllerName, $actionName, $this->getControllerClass($controllerName));
|
| 78 |
}
|
| 79 |
|
| 80 |
/**
|
| 81 |
* 执行指定的 Action 方法
|
| 82 |
*
|
| 83 |
* @param string $controllerName
|
| 84 |
* @param string $actionName
|
| 85 |
* @param string $controllerClass
|
| 86 |
*
|
| 87 |
* @return mixed
|
Filename: /var/www/html/hsj/home/FLEA/FLEA.php
#2
flea_dispatcher_simple::dispatching()
FILE: FLEA.php
LINE: 621
ARGS:
Array
(
)
SOURCE CODE:
| 611 |
require_once($MVCPackageFilename);
|
| 612 |
}
|
| 613 |
FLEA::init();
|
| 614 |
|
| 615 |
// 载入调度器并转发请求到控制器
|
| 616 |
$dispatcherClass = FLEA::getAppInf('dispatcher');
|
| 617 |
FLEA::loadClass($dispatcherClass);
|
| 618 |
|
| 619 |
$dispatcher =& new $dispatcherClass($_GET);
|
| 620 |
FLEA::register($dispatcher, $dispatcherClass);
|
| 621 |
$dispatcher->dispatching();
|
| 622 |
}
|
| 623 |
|
| 624 |
/**
|
| 625 |
* 准备运行环境
|
| 626 |
*
|
| 627 |
* @param boolean $loadMVC
|
| 628 |
*/
|
| 629 |
function init($loadMVC = false)
|
| 630 |
{
|
| 631 |
static $firstTime = true;
|
Filename: /var/www/html/hsj/home/home.php
#1
flea::runmvc()
FILE: home.php
LINE: 42
ARGS:
Array
(
)
SOURCE CODE:
| 32 |
//FLEA框架文件
|
| 33 |
require('./FLEA/FLEA.php');
|
| 34 |
//公共函数库
|
| 35 |
require('./functions.php');
|
| 36 |
|
| 37 |
|
| 38 |
//导入框架配置参数
|
| 39 |
FLEA::loadAppInf('./config.php');
|
| 40 |
FLEA::setAppInf('dbDSN',$dsn);
|
| 41 |
FLEA::import(APP_DIR . DS . 'APP');
|
| 42 |
FLEA::runMVC();
|
| 43 |
|
| 44 |
|
| 45 |
?> |