Exception: FLEA_Db_Exception_SqlQuery
Message: SQL Error Message: "Can't connect to MySQL server on 'localhost' (10061)"
SQL : "mysql_connect('localhost:3308', 'verymore') failed!"
SQL Error code: "7335941".
Filename: D:\Web\ZhuGuangYe\verymore\Lib\FLEA\FLEA.php [752]
#10 FLEA_Db_Driver_Mysql::connect()
ARGS:
Array
(
)
SOURCE CODE:
| 742 |
|
| 743 |
$driver = ucfirst(strtolower($dsn['driver']));
|
| 744 |
$className = 'FLEA_Db_Driver_' . $driver;
|
| 745 |
if ($driver == 'Mysql' || $driver == 'Mysqlt') {
|
| 746 |
require_once(FLEA_DIR . '/Db/Driver/Mysql.php');
|
| 747 |
} else {
|
| 748 |
FLEA::loadClass($className);
|
| 749 |
}
|
| 750 |
$dbo =& new $className($dsn);
|
| 751 |
/* @var $dbo FLEA_Db_Driver_Abstract */
|
| 752 |
$dbo->connect();
|
| 753 |
|
| 754 |
$GLOBALS[G_FLEA_VAR]['DBO'][$dsnid] =& $dbo;
|
| 755 |
return $GLOBALS[G_FLEA_VAR]['DBO'][$dsnid];
|
| 756 |
}
|
| 757 |
|
| 758 |
/**
|
| 759 |
* 分析 DSN 字符串或数组,返回包含 DSN 连接信息的数组,失败返回 false
|
| 760 |
*
|
| 761 |
* @param string|array $dsn
|
| 762 |
*
|
Filename: D:\Web\ZhuGuangYe\verymore\Lib\FLEA\FLEA\Db\TableDataGateway.php [301]
#9 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: D:\Web\ZhuGuangYe\verymore\Lib\FLEA\FLEA.php [422]
#8 FLEA_Db_TableDataGateway::FLEA_Db_TableDataGateway()
ARGS:
Array
(
)
SOURCE CODE:
| 412 |
} else {
|
| 413 |
$classExists = class_exists($className);
|
| 414 |
}
|
| 415 |
if (!$classExists) {
|
| 416 |
if (!FLEA::loadClass($className)) {
|
| 417 |
$return = false;
|
| 418 |
return $return;
|
| 419 |
}
|
| 420 |
}
|
| 421 |
|
| 422 |
$instances[$className] =& new $className();
|
| 423 |
FLEA::register($instances[$className], $className);
|
| 424 |
return $instances[$className];
|
| 425 |
}
|
| 426 |
|
| 427 |
/**
|
| 428 |
* 将一个对象实例注册到对象实例容器,以便稍后取出
|
| 429 |
*
|
| 430 |
* example:
|
| 431 |
* <code>
|
| 432 |
* $obj =& new MyClass();
|
Filename: D:\Web\ZhuGuangYe\verymore\App\music\Model\CacheView.php [19]
#7 FLEA::getSingleton('Table_Music')
ARGS:
Array
(
[0] => Table_Music
)
SOURCE CODE:
| 9 |
var $uploadDir;
|
| 10 |
var $tableMusic;
|
| 11 |
|
| 12 |
function Model_CacheView()
|
| 13 |
{
|
| 14 |
$this->id = (isset($_GET['id']))?(int)$_GET['id']:1;
|
| 15 |
//$cacheView = 'musicView'.$this->id;
|
| 16 |
//$this->musicView = FLEA::getCache($cacheView, $this->cacheViewTime);
|
| 17 |
//if (!$this->musicView) {
|
| 18 |
// 从数据库读取数据
|
| 19 |
$this->tableMusic =& FLEA::getSingleton('Table_Music');
|
| 20 |
$this->musicView = $this->tableMusic->find('id = '.$this->id.' AND error = 0 AND hide = 0', 'id DESC');
|
| 21 |
//FLEA::writeCache($cacheView, $this->musicView);
|
| 22 |
if (!$this->musicView) {
|
| 23 |
header('Location: /music/error/');
|
| 24 |
exit();
|
| 25 |
}
|
| 26 |
//}
|
| 27 |
}
|
| 28 |
|
| 29 |
function cacheView(){
|
Filename: D:\Web\ZhuGuangYe\verymore\Lib\FLEA\FLEA.php [422]
#6 Model_CacheView::Model_CacheView()
ARGS:
Array
(
)
SOURCE CODE:
| 412 |
} else {
|
| 413 |
$classExists = class_exists($className);
|
| 414 |
}
|
| 415 |
if (!$classExists) {
|
| 416 |
if (!FLEA::loadClass($className)) {
|
| 417 |
$return = false;
|
| 418 |
return $return;
|
| 419 |
}
|
| 420 |
}
|
| 421 |
|
| 422 |
$instances[$className] =& new $className();
|
| 423 |
FLEA::register($instances[$className], $className);
|
| 424 |
return $instances[$className];
|
| 425 |
}
|
| 426 |
|
| 427 |
/**
|
| 428 |
* 将一个对象实例注册到对象实例容器,以便稍后取出
|
| 429 |
*
|
| 430 |
* example:
|
| 431 |
* <code>
|
| 432 |
* $obj =& new MyClass();
|
Filename: D:\Web\ZhuGuangYe\verymore\App\music\Controller\View.php [37]
#5 FLEA::getSingleton('Model_CacheView')
ARGS:
Array
(
[0] => Model_CacheView
)
SOURCE CODE:
| 27 |
|
| 28 |
|
| 29 |
$viewConfig = & FLEA::getAppInf ( 'viewConfig' );
|
| 30 |
$smarty->cache_dir = $viewConfig ['cache_dir'] . '/view'; //cache的文件夹更改为view
|
| 31 |
|
| 32 |
|
| 33 |
$categoryList = & FLEA::getSingleton ( 'Model_CacheCategory' ); //为了动态显示不同的音乐风格,分类不能被缓存
|
| 34 |
$categoryList1 = $categoryList->cacheCategory1 ();
|
| 35 |
$smarty->assign ( 'categoryList', $categoryList1 );
|
| 36 |
|
| 37 |
$musicView = & FLEA::getSingleton ( 'Model_CacheView' ); //为了动态显示不同的音乐风格,当前分类ID不能被缓存
|
| 38 |
$musicView = $musicView->cacheView ();
|
| 39 |
$torrent = & FLEA::getSingleton ( 'Model_Torrent' ); //为了动态显示不同的音乐风格,当前分类ID不能被缓存
|
| 40 |
$torrent->fileurl = $musicView ['fileurl'];
|
| 41 |
$musicView ['torrent'] = $torrent->torrent ();
|
| 42 |
$comment = & FLEA::getSingleton ( 'Model_Comment' );
|
| 43 |
$commentList = $comment->viewComment($this->id);
|
| 44 |
$smarty->assign ( 'cid', $musicView ['cid'] );
|
| 45 |
$smarty->assign ( 'digg', $musicView ['digg'] );
|
| 46 |
$smarty->assign ( 'commentList', $commentList );
|
| 47 |
|
Filename: D:\Web\ZhuGuangYe\verymore\Lib\FLEA\FLEA\Dispatcher\Simple.php [120]
#4 Controller_View::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) {
|
| 129 |
// 检查是否调用应用程序设置的错误处理程序
|
| 130 |
$args = array($controllerName, $actionName, $controllerClass);
|
Filename: D:\Web\ZhuGuangYe\verymore\Lib\FLEA\FLEA\Dispatcher\Simple.php [77]
#3 FLEA_Dispatcher_Simple::_executeAction('view', 'index', 'Controller_View')
ARGS:
Array
(
[0] => view
[1] => index
[2] => Controller_View
)
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: D:\Web\ZhuGuangYe\verymore\Lib\FLEA\FLEA.php [816]
#2 FLEA_Dispatcher_Simple::dispatching()
ARGS:
Array
(
)
SOURCE CODE:
| 806 |
require_once($MVCPackageFilename);
|
| 807 |
}
|
| 808 |
FLEA::init();
|
| 809 |
|
| 810 |
// 载入调度器并转发请求到控制器
|
| 811 |
$dispatcherClass = FLEA::getAppInf('dispatcher');
|
| 812 |
FLEA::loadClass($dispatcherClass);
|
| 813 |
|
| 814 |
$dispatcher =& new $dispatcherClass($_GET);
|
| 815 |
FLEA::register($dispatcher, $dispatcherClass);
|
| 816 |
$dispatcher->dispatching();
|
| 817 |
}
|
| 818 |
|
| 819 |
/**
|
| 820 |
* 准备运行环境
|
| 821 |
*
|
| 822 |
* @param boolean $loadMVC
|
| 823 |
*/
|
| 824 |
function init($loadMVC = false)
|
| 825 |
{
|
| 826 |
static $firstTime = true;
|
Filename: D:\Web\ZhuGuangYe\verymore\Web\music\index.php [9]
#1 FLEA::runMVC()
ARGS:
Array
(
)
SOURCE CODE:
| 1 |
<?php
|
| 2 |
date_default_timezone_set('PRC');//设置时区为中国
|
| 3 |
define('ROOT_DIR', dirname(__FILE__) . '/../../');
|
| 4 |
define('NO_LEGACY_FLEAPHP', true); //取消与旧版FleaPHP兼容,可以节约资源
|
| 5 |
//define('DEPLOY_MODE', true); //部署模式
|
| 6 |
require(ROOT_DIR . '/Lib/FLEA/FLEA.php');
|
| 7 |
FLEA::import(ROOT_DIR . '/App/music/');
|
| 8 |
FLEA::loadAppInf(ROOT_DIR . '/App/music/Config/Default_APP_INF.php');
|
| 9 |
FLEA::runMVC();
|
| 10 |
?> |