数据库链接错误/无法找到数据库 : Access denied for user 'shopbingshuo'@'%' to database 'shopbingshuo'
- /data/project/shop-bingshuo/php/SpeedPHP/Drivers/mysqli.php on line 94
89.
public function __construct($dbConfig)
90.
{
91.
if(!function_exists('mysqli_connect'))spError('PHP环境未安装MySQLi函数库!');
92.
$linkfunction = ( TRUE == $dbConfig['persistent'] ) ? 'mysqli_pconnect' : 'mysqli_connect';
93.
$this->conn = $linkfunction($dbConfig['host'], $dbConfig['login'], $dbConfig['password'], $dbConfig['database'], $dbConfig['port']);
94.
95.
if(mysqli_connect_errno())spError('数据库链接错误/无法找到数据库 : '. mysqli_connect_error());
$this->exec("SET NAMES UTF8");
96.
}
97.
/**
98.
* 对特殊字符进行过滤
99.
*
- /data/project/shop-bingshuo/php/SpeedPHP/spFunctions.php on line 164
159.
}
160.
if(FALSE != $has_define){
161.
$argString = '';$comma = '';
162.
if(null != $args)for ($i = 0; $i < count($args); $i ++) { $argString .= $comma . "\$args[$i]"; $comma = ', ';}
163.
if($cache_inst) {
164.
165.
eval("\$GLOBALS['G_SP']['inst_class'][\$class_name] = new \$class_name($argString);");
return $GLOBALS['G_SP']["inst_class"][$class_name];
166.
}else {
167.
eval("\$tmpCls = new \$class_name($argString);");
168.
return $tmpCls;
169.
}
- /data/project/shop-bingshuo/php/SpeedPHP/Core/spModel.php on line 56
51.
}
52.
$forceInst = $GLOBALS['G_SP']['controller_other_db'] ? true : false;
53.
if($GLOBALS['G_SP']['controller_other_db'] && in_array($this->tbl_name, $GLOBALS['G_SP']['controller_other_db'])){
54.
$this->_db = spClass('db_'.$GLOBALS['G_SP']['db_other']['driver'], array(0=>$GLOBALS['G_SP']['db_other']), $GLOBALS['G_SP']['db_driver_path'], $forceInst);
55.
}else{
56.
57.
$this->_db = spClass('db_'.$GLOBALS['G_SP']['db']['driver'], array(0=>$GLOBALS['G_SP']['db']), $GLOBALS['G_SP']['db_driver_path'], $forceInst);
}
58.
}
59.
60.
/**
61.
* 从数据表中查找一条记录
- /data/project/shop-bingshuo/php/SpeedPHP/spFunctions.php on line 164
159.
}
160.
if(FALSE != $has_define){
161.
$argString = '';$comma = '';
162.
if(null != $args)for ($i = 0; $i < count($args); $i ++) { $argString .= $comma . "\$args[$i]"; $comma = ', ';}
163.
if($cache_inst) {
164.
165.
eval("\$GLOBALS['G_SP']['inst_class'][\$class_name] = new \$class_name($argString);");
return $GLOBALS['G_SP']["inst_class"][$class_name];
166.
}else {
167.
eval("\$tmpCls = new \$class_name($argString);");
168.
return $tmpCls;
169.
}
- /data/project/shop-bingshuo/php/SpeedPHP/spFunctions.php on line 561
556.
* 获取产品分类设定数组(很重要,spUrlRewrite需要用到)
557.
* @param string $suffix 如果赋值,则在产品key名后面增加后缀(主要用于rewrite识别模板二级目录)
558.
* @return array
559.
*/
560.
function getProductArr($suffix = ''){
561.
562.
$data = spClass('m_product')->spCache()->getProduct("status = 1", 'product');
if($suffix){
563.
foreach($data as $k=>$v){
564.
$data[$k] = $v.$suffix;
565.
}
566.
$data[] = 'tpl'; //模板引导页
- /data/project/shop-bingshuo/php/SpeedPHP/Extensions/spUrlRewrite.php on line 100
95.
$requestUriArr = explode('/', $_SERVER['REQUEST_URI'] );
96.
$requestUriArr = explode('.', $requestUriArr[1]);
97.
98.
$requestUri = $requestUriArr[0]; //通过两次分割取出最终请求控制器名称
99.
$productController = 0; //初始化产品控制器请求状态,便于后续判断处理
100.
101.
$productControllerArr = array_merge(getProductArr(), getExtraClassify()); //定义需要特殊处理的产品控制器名称(产品key)数组
$stationController = 0; //初始化城市分站控制器请求状态,便于后续判断处理
102.
$stationControllerArr = getStationArr('domain'); //定义需要特殊处理的地区分站控制器名称(地区key)数组
103.
$templateController = 0; //初始化模板控制器请求状态,便于后续判断处理
104.
$templateControllerArr = getProductArr('tpl'); //定义需要特殊处理的产品模板控制器名称(产品key+'tpl')数组
105.
//原创的定向改造
- /data/project/shop-bingshuo/php/SpeedPHP/spFunctions.php on line 201
196.
*/
197.
function spLaunch($configname, $launchargs = null, $returns = FALSE ){
198.
if( isset($GLOBALS['G_SP']['launch'][$configname]) && is_array($GLOBALS['G_SP']['launch'][$configname]) ){
199.
foreach( $GLOBALS['G_SP']['launch'][$configname] as $launch ){
200.
if( is_array($launch) ){
201.
202.
$reval = spClass($launch[0])->{$launch[1]}($launchargs);
}else{
203.
$reval = call_user_func_array($launch, $launchargs);
204.
}
205.
if( TRUE == $returns )return $reval;
206.
}
- /data/project/shop-bingshuo/php/SpeedPHP/spFunctions.php on line 23
18.
return date("Y-m-d H:i:s",$dateInteger+3600*6);
19.
}
20.
function spRun(){
21.
GLOBAL $__controller, $__action;
22.
// 对路由进行自动执行相关操作
23.
24.
spLaunch("router_prefilter");
// 对将要访问的控制器类进行实例化
25.
$handle_controller = spClass($__controller, null, $GLOBALS['G_SP']["controller_path"].'/'.$__controller.".php");
26.
// 调用控制器出错将调用路由错误处理函数
27.
if(!is_object($handle_controller) || !method_exists($handle_controller, $__action)){
28.
//header('location: /main/notfound'.$_SERVER['REQUEST_URI'].'.html');exit();//用于调试显示哪个请求不存在
- /data/project/shop-bingshuo/php/index.php on line 3
1.
<?php
2.
require(SP_PATH."/SpeedPHP.php");
3.
spRun();
- /data/project/shop-bingshuo/web/pc/index.php on line 4
1.
<?php
2.
header('Access-Control-Allow-Origin:*');
3.
$spConfig = require(dirname(dirname(__DIR__)) . '/config/config-pc.php');
4.
require(BASE_PATH."/index.php");