Exception: FLEA_Db_Exception_SqlQuery
Message: SQL 语句: "mysql_connect('localhost:6033', 'root') failed!"
SQL 错误代码: "7335942".
Filename: /www/c/ch/china.hibuyers.com/Libs/FLEA/FLEA.php [739]
#9 FLEA_Db_Driver_Mysql::connect()
ARGS:
Array
(
)
SOURCE CODE:
| 729 |
|
| 730 |
$driver = ucfirst(strtolower($dsn['driver']));
|
| 731 |
$className = 'FLEA_Db_Driver_' . $driver;
|
| 732 |
if ($driver == 'Mysql' || $driver == 'Mysqlt') {
|
| 733 |
require_once(FLEA_DIR . '/Db/Driver/Mysql.php');
|
| 734 |
} else {
|
| 735 |
FLEA::loadClass($className);
|
| 736 |
}
|
| 737 |
$dbo =& new $className($dsn);
|
| 738 |
/* @var $dbo FLEA_Db_Driver_Abstract */
|
| 739 |
$dbo->connect();
|
| 740 |
|
| 741 |
$GLOBALS[G_FLEA_VAR]['DBO'][$dsnid] =& $dbo;
|
| 742 |
return $GLOBALS[G_FLEA_VAR]['DBO'][$dsnid];
|
| 743 |
}
|
| 744 |
|
| 745 |
/**
|
| 746 |
* 分析 DSN 字符串或数组,返回包含 DSN 连接信息的数组,失败返回 false
|
| 747 |
*
|
| 748 |
* @param string|array $dsn
|
| 749 |
*
|
Filename: /www/c/ch/china.hibuyers.com/Libs/FLEA/FLEA/Db/TableDataGateway.php [301]
#8 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: /www/c/ch/china.hibuyers.com/Libs/FLEA/FLEA.php [425]
#7 FLEA_Db_TableDataGateway::FLEA_Db_TableDataGateway()
ARGS:
Array
(
)
SOURCE CODE:
| 415 |
} else {
|
| 416 |
$classExists = class_exists($className);
|
| 417 |
}
|
| 418 |
if (!$classExists) {
|
| 419 |
if (!FLEA::loadClass($className)) {
|
| 420 |
$return = false;
|
| 421 |
return $return;
|
| 422 |
}
|
| 423 |
}
|
| 424 |
|
| 425 |
$instances[$className] =& new $className();
|
| 426 |
FLEA::register($instances[$className], $className);
|
| 427 |
return $instances[$className];
|
| 428 |
}
|
| 429 |
|
| 430 |
/**
|
| 431 |
* 将一个对象实例注册到对象实例容器,以便稍后取出
|
| 432 |
*
|
| 433 |
* example:
|
| 434 |
* <code>
|
| 435 |
* $obj =& new MyClass();
|
Filename: /www/c/ch/china.hibuyers.com/App/Controller/Default.php [484]
#6 FLEA::getSingleton('Table_Searchkey')
ARGS:
Array
(
[0] => Table_Searchkey
)
SOURCE CODE:
| 474 |
$FriendLink[$val['classid']]['link'][] = $val;
|
| 475 |
$FriendLink[$val['classid']]['classname'] = $val['classname'];
|
| 476 |
}
|
| 477 |
}
|
| 478 |
$this->smarty->assign('FriendLink', $FriendLink);
|
| 479 |
}
|
| 480 |
$this->smarty->display('FriendLink.html','FriendLink');
|
| 481 |
}
|
| 482 |
|
| 483 |
function _getKey($Limit = 0, $ClassId = 0, $istop = 0, $byChlid = false) {
|
| 484 |
$tableKey =& FLEA::getSingleton('Table_Searchkey');
|
| 485 |
$tableKey->disableLinks();
|
| 486 |
$istop = intval($istop);
|
| 487 |
$Limit = intval($Limit);
|
| 488 |
$ClassId = intval($ClassId);
|
| 489 |
if($istop) $sqlWhere = " AND istop=1";
|
| 490 |
if($Limit) $sqlLimit = " LIMIT $Limit";
|
| 491 |
if($byChlid){
|
| 492 |
$dataKey = $tableKey->findBySql("SELECT key_id,flag,keyname,parent_id FROM searchkey WHERE parent_id=0 $sqlWhere ORDER BY addtime DESC $sqlLimit");
|
| 493 |
foreach($dataKey AS $key=>$value){
|
| 494 |
$dataKey[$key]['childkey'] = $tableKey->findBySql("SELECT key_id,flag,keyname,parent_id FROM searchkey WHERE parent_id=".$value['key_id']." $sqlWhere ORDER BY addtime DESC LIMIT 10");
|
Filename: /www/c/ch/china.hibuyers.com/App/Controller/Default.php [13]
#5 Controller_Default::_getKey(12)
ARGS:
Array
(
[0] => 12
)
SOURCE CODE:
| 3 |
{
|
| 4 |
var $QueryString = array();
|
| 5 |
var $navigation = '<a href="index.php">首页</a> > ';
|
| 6 |
var $Cache,$tpp,$page,$flag,$city,$cacheId,$cachedr,$toPage,$action,$smarty,$meta,$cartCount;
|
| 7 |
|
| 8 |
function Controller_Default() {
|
| 9 |
FLEA::loadFile('Admin_Modules_Cache');
|
| 10 |
$this->Cache =& new Modules_Cache();
|
| 11 |
$cart = unserialize($_COOKIE['cart']);
|
| 12 |
$this->cartCount = $cart['count'] ? $cart['count'] : 0;
|
| 13 |
$TopkeyList = $this->_getKey(12);
|
| 14 |
$this->QueryString = getQueryString();
|
| 15 |
$this->smarty =& parent::_getView();
|
| 16 |
$this->smarty->caching = true;
|
| 17 |
$this->smarty->cache_lifetime = SEARCHCACHETIME;
|
| 18 |
$this->smarty->clear_all_assign();
|
| 19 |
$this->tpp = 10;
|
| 20 |
$this->action = $_GET['action'];
|
| 21 |
$this->city = $this->QueryString['city'] ? $this->QueryString['city'] : 0;
|
| 22 |
$this->flag = $this->QueryString['flag'] ? $this->QueryString['flag'] : 0;
|
| 23 |
$this->classID = $this->QueryString['classid'] ? intval($this->QueryString['classid']) : 0;
|
Filename: /www/c/ch/china.hibuyers.com/Libs/FLEA/FLEA/Dispatcher/Simple.php [106]
#4 Controller_Default::Controller_Default('Default')
ARGS:
Array
(
[0] => Default
)
SOURCE CODE:
| 96 |
|
| 97 |
$controller = null;
|
| 98 |
$controllerClassFilename = null;
|
| 99 |
do {
|
| 100 |
// 载入控制对应的类定义
|
| 101 |
if (!$this->_loadController($controllerClass)) { break; }
|
| 102 |
|
| 103 |
// 构造控制器对象
|
| 104 |
FLEA::setAppInf('FLEA.internal.currentControllerName', $controllerName);
|
| 105 |
FLEA::setAppInf('FLEA.internal.currentActionName', $actionName);
|
| 106 |
$controller =& new $controllerClass($controllerName);
|
| 107 |
if (!method_exists($controller, $actionMethod)) { break; }
|
| 108 |
if (method_exists($controller, '__setController')) {
|
| 109 |
$controller->__setController($controllerName, $actionName);
|
| 110 |
}
|
| 111 |
if (method_exists($controller, '__setDispatcher')) {
|
| 112 |
$controller->__setDispatcher($this);
|
| 113 |
}
|
| 114 |
|
| 115 |
// 调用 _beforeExecute() 方法
|
| 116 |
if (method_exists($controller, '_beforeExecute')) {
|
Filename: /www/c/ch/china.hibuyers.com/Libs/FLEA/FLEA/Dispatcher/Simple.php [77]
#3 FLEA_Dispatcher_Simple::_executeAction('Default', 'index', 'Controller_Default')
ARGS:
Array
(
[0] => Default
[1] => index
[2] => Controller_Default
)
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: /www/c/ch/china.hibuyers.com/Libs/FLEA/FLEA.php [803]
#2 FLEA_Dispatcher_Simple::dispatching()
ARGS:
Array
(
)
SOURCE CODE:
| 793 |
require_once($MVCPackageFilename);
|
| 794 |
}
|
| 795 |
FLEA::init();
|
| 796 |
|
| 797 |
// 载入调度器并转发请求到控制器
|
| 798 |
$dispatcherClass = FLEA::getAppInf('dispatcher');
|
| 799 |
FLEA::loadClass($dispatcherClass);
|
| 800 |
|
| 801 |
$dispatcher =& new $dispatcherClass($_GET);
|
| 802 |
FLEA::register($dispatcher, $dispatcherClass);
|
| 803 |
$dispatcher->dispatching();
|
| 804 |
}
|
| 805 |
|
| 806 |
/**
|
| 807 |
* 准备运行环境
|
| 808 |
*
|
| 809 |
* @param boolean $loadMVC
|
| 810 |
*/
|
| 811 |
function init($loadMVC = false)
|
| 812 |
{
|
| 813 |
static $firstTime = true;
|
Filename: /www/c/ch/china.hibuyers.com/index.php [27]
#1 FLEA::runMVC()
ARGS:
Array
(
)
SOURCE CODE:
| 17 |
'compile_dir' => APP_ROOT . '/Caches/Templates_c',
|
| 18 |
'config_dir' => APP_ROOT . '/Caches/Configs',
|
| 19 |
'cache_dir' => APP_ROOT . '/Caches/Cache',
|
| 20 |
'left_delimiter' => '<!--{',
|
| 21 |
'right_delimiter' => '}-->',
|
| 22 |
);
|
| 23 |
|
| 24 |
FLEA::setAppInf('viewConfig',$viewConfig);
|
| 25 |
FLEA::setAppInf('controllerAccessor','c');
|
| 26 |
FLEA::import(APP_ROOT . '/App');
|
| 27 |
FLEA::runMVC();
|
| 28 |
?> |