NOTICE: Undefined index: MYSQL_DB in /data1/www/htdocs/569/speedphp/1/protected/lib/speed.php on line 329
- /data1/www/htdocs/569/speedphp/1/protected/lib/speed.php on line 495
490.
$msg = "ERROR";
491.
if($errno == E_WARNING)$msg = "WARNING";
492.
if($errno == E_NOTICE)$msg = "NOTICE";
493.
if($errno == E_STRICT)$msg = "STRICT";
494.
if($errno == 8192)$msg = "DEPRECATED";
495.
496.
err("$msg: $errstr in $errfile on line $errline");
}
497.
function err($msg){
498.
$msg = htmlspecialchars($msg);
499.
$traces = debug_backtrace();
500.
if(!$GLOBALS['debug']){
- /data1/www/htdocs/569/speedphp/1/protected/lib/speed.php on line 329
324.
}
325.
326.
public function dbInstance($db_config, $db_config_key, $force_replace = false){
327.
if($force_replace || empty($GLOBALS['mysql_instances'][$db_config_key])){
328.
try {
329.
330.
$GLOBALS['mysql_instances'][$db_config_key] = new PDO('mysql:dbname='.$db_config['MYSQL_DB'].';host='.$db_config['MYSQL_HOST'].';port='.$db_config['MYSQL_PORT'], $db_config['MYSQL_USER'], $db_config['MYSQL_PASS'], array(PDO::MYSQL_ATTR_INIT_COMMAND=>'SET NAMES \''.$db_config['MYSQL_CHARSET'].'\''));
}catch(PDOException $e){err('Database Err: '.$e->getMessage());}
331.
}
332.
return $GLOBALS['mysql_instances'][$db_config_key];
333.
}
334.
- /data1/www/htdocs/569/speedphp/1/protected/lib/speed.php on line 303
298.
299.
if($readonly && !empty($GLOBALS['mysql']['MYSQL_SLAVE'])){
300.
$slave_key = array_rand($GLOBALS['mysql']['MYSQL_SLAVE']);
301.
$sth = $this->dbInstance($GLOBALS['mysql']['MYSQL_SLAVE'][$slave_key], 'slave_'.$slave_key)->prepare($sql);
302.
}else{
303.
304.
$sth = $this->dbInstance($GLOBALS['mysql'], 'master')->prepare($sql);
}
305.
306.
if(is_array($params) && !empty($params)){
307.
foreach($params as $k => &$v){
308.
if(is_int($v)){
- /data1/www/htdocs/569/speedphp/1/protected/lib/speed.php on line 231
226.
foreach ($row as $k=>$v){
227.
$values[":M_UPDATE_".$k] = $v;
228.
$setstr[] = "`{$k}` = ".":M_UPDATE_".$k;
229.
}
230.
$conditions = $this->_where( $conditions );
231.
232.
return $this->execute("UPDATE ".$this->table_name." SET ".implode(', ', $setstr).$conditions["_where"], $conditions["_bindParams"] + $values);
}
233.
234.
public function incr($conditions, $field, $optval = 1){
235.
$conditions = $this->_where( $conditions );
236.
return $this->execute("UPDATE ".$this->table_name." SET `{$field}` = `{$field}` + :M_INCR_VAL ".$conditions["_where"], $conditions["_bindParams"] + array(":M_INCR_VAL" => $optval));
- /data1/www/htdocs/569/speedphp/1/protected/controller/DbController.php on line 28
23.
// 修改uid=2的名字为whoami
24.
$this->result = $user->update(array(
25.
"uid" => "2" // 条件
26.
), array(
27.
"username" => "whoami" // 修改的内容,键是字段名
28.
29.
));
// update返回结果是影响行数,返回0证明查询不到对应条件的数据
30.
31.
$this->findall = $user->findAll();
32.
$this->display("db/update.html");
33.
}
- /data1/www/htdocs/569/speedphp/1/protected/lib/speed.php on line 80
75.
if(!is_available_classname($__controller))_err_router("Err: Controller '$controller_name' is not correct!");
76.
if(!class_exists($controller_name, true))_err_router("Err: Controller '$controller_name' is not exists!");
77.
if(!method_exists($controller_name, $action_name))_err_router("Err: Method '$action_name' of '$controller_name' is not exists!");
78.
79.
$controller_obj = new $controller_name();
80.
81.
$controller_obj->$action_name();
82.
if($controller_obj->_auto_display){
83.
$auto_tpl_name = (empty($__module) ? '' : $__module.DS).$__controller.'_'.$__action.'.html';
84.
if(file_exists(APP_DIR.DS.'protected'.DS.'view'.DS.$auto_tpl_name))$controller_obj->display($auto_tpl_name);
85.
}
- /data1/www/htdocs/569/speedphp/1/index.php on line 3
1.
<?php
2.
define('APP_DIR', realpath('./'));
3.
require(APP_DIR.'/protected/lib/speed.php');