在cli环境下,PHP程序需要长时间运行,客户端与MySQL服务器之间的TCP连接是不稳定的。

  • MySQL-Server会在一定时间内自动切断连接
  • PHP程序遇到空闲期时长时间没有MySQL查询,MySQL-Server也会切断连接回收资源
  • 其他情况,在MySQL服务器中执行kill process杀掉某个连接,MySQL服务器重启

所以我们要考虑数据库断线重连的问题,但是ThinkPHP3.2里DB驱动类里并没有断线重连的例子,好消息是TP5里有,于是我照着TP5里的源码,改了TP3.2里的DB驱动类,来达到数据库断线自动重连。

附上代码

完整的DB.class.php文件 保证可用。

<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// 2017-8-24 09:26:23 增加了断线重连功能namespace Think\Db;
use Think\Config;
use Think\Debug;
use Think\Log;
use PDO;abstract class Driver {// PDO操作实例protected $PDOStatement = null;// 当前操作所属的模型名protected $model      = '_think_';// 当前SQL指令protected $queryStr   = '';protected $modelSql   = array();// 最后插入IDprotected $lastInsID  = null;// 返回或者影响记录数protected $numRows    = 0;// 事务指令数protected $transTimes = 0;// 错误信息protected $error      = '';// 数据库连接ID 支持多个连接protected $linkID     = array();// 当前连接IDprotected $_linkID    = null;// 数据库连接参数配置protected $config     = array('type'              =>  '',     // 数据库类型'hostname'          =>  '127.0.0.1', // 服务器地址'database'          =>  '',          // 数据库名'username'          =>  '',      // 用户名'password'          =>  '',          // 密码'hostport'          =>  '',        // 端口'dsn'               =>  '', //'params'            =>  array(), // 数据库连接参数'charset'           =>  'utf8',      // 数据库编码默认采用utf8'prefix'            =>  '',    // 数据库表前缀'debug'             =>  false, // 数据库调试模式'deploy'            =>  0, // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)'rw_separate'       =>  false,       // 数据库读写是否分离 主从式有效'master_num'        =>  1, // 读写分离后 主服务器数量'slave_no'          =>  '', // 指定从服务器序号'db_like_fields'    =>  '',);// 数据库表达式protected $exp = array('eq'=>'=','neq'=>'<>','gt'=>'>','egt'=>'>=','lt'=>'<','elt'=>'<=','notlike'=>'NOT LIKE','like'=>'LIKE','in'=>'IN','notin'=>'NOT IN','not in'=>'NOT IN','between'=>'BETWEEN','not between'=>'NOT BETWEEN','notbetween'=>'NOT BETWEEN');// 查询表达式protected $selectSql  = 'SELECT%DISTINCT% %FIELD% FROM %TABLE%%FORCE%%JOIN%%WHERE%%GROUP%%HAVING%%ORDER%%LIMIT% %UNION%%LOCK%%COMMENT%';// 查询次数protected $queryTimes   =   0;// 执行次数protected $executeTimes =   0;// PDO连接参数protected $options = array(PDO::ATTR_CASE              =>  PDO::CASE_LOWER,PDO::ATTR_ERRMODE           =>  PDO::ERRMODE_EXCEPTION,PDO::ATTR_ORACLE_NULLS      =>  PDO::NULL_NATURAL,PDO::ATTR_STRINGIFY_FETCHES =>  false,);protected $bind         =   array(); // 参数绑定/*** 架构函数 读取数据库配置信息* @access public* @param array $config 数据库配置数组*/public function __construct($config=''){if(!empty($config)) {$this->config   =   array_merge($this->config,$config);if(is_array($this->config['params'])){$this->options  =   $this->config['params'] + $this->options;}}}/*** 连接数据库方法* @access public*/public function connect($config='',$linkNum=0,$autoConnection=false) {if ( !isset($this->linkID[$linkNum]) ) {if(empty($config))  $config =   $this->config;try{if(empty($config['dsn'])) {$config['dsn']  =   $this->parseDsn($config);}if(version_compare(PHP_VERSION,'5.3.6','<=')){// 禁用模拟预处理语句$this->options[PDO::ATTR_EMULATE_PREPARES]  =   false;}$this->linkID[$linkNum] = new PDO( $config['dsn'], $config['username'], $config['password'],$this->options);}catch (\PDOException $e) {if($autoConnection){trace($e->getMessage(),'','ERR');return $this->connect($autoConnection,$linkNum);}elseif($config['debug']){E($e->getMessage());}}}return $this->linkID[$linkNum];}/*** 解析pdo连接的dsn信息* @access public* @param array $config 连接信息* @return string*/protected function parseDsn($config){}/*** 释放查询结果* @access public*/public function free() {$this->PDOStatement = null;}/*** 执行查询 返回数据集* @access public* @param string $str  sql指令* @param boolean $fetchSql  不执行只是获取SQL* @return mixed*/public function query($str,$fetchSql=false) {$this->initConnect(false);if ( !$this->_linkID ) return false;$this->queryStr     =   $str;if(!empty($this->bind)){$that   =   $this;$this->queryStr =   strtr($this->queryStr,array_map(function($val) use($that){ return '\''.$that->escapeString($val).'\''; },$this->bind));}if($fetchSql){return $this->queryStr;}//释放前次的查询结果if ( !empty($this->PDOStatement) ) $this->free();$this->queryTimes++;N('db_query',1); // 兼容代码// 调试开始$this->debug(true);$this->PDOStatement = $this->_linkID->prepare($str);if(false === $this->PDOStatement){$this->error('query');return false;}foreach ($this->bind as $key => $val) {if(is_array($val)){$this->PDOStatement->bindValue($key, $val[0], $val[1]);}else{$this->PDOStatement->bindValue($key, $val);}}$this->bind =   array();$result =   $this->PDOStatement->execute();// 调试结束$this->debug(false);if ( false === $result ) {$this->error('query');return false;} else {return $this->getResult();}}/*** 执行语句* @access public* @param string $str  sql指令* @param boolean $fetchSql  不执行只是获取SQL* @return mixed*/public function execute($str,$fetchSql=false) {$this->initConnect(true);if ( !$this->_linkID ) return false;$this->queryStr = $str;if(!empty($this->bind)){$that   =   $this;$this->queryStr =   strtr($this->queryStr,array_map(function($val) use($that){ return '\''.$that->escapeString($val).'\''; },$this->bind));}if($fetchSql){return $this->queryStr;}//释放前次的查询结果if ( !empty($this->PDOStatement) ) $this->free();$this->executeTimes++;N('db_write',1); // 兼容代码// 记录开始执行时间$this->debug(true);$this->PDOStatement =   $this->_linkID->prepare($str);if(false === $this->PDOStatement) {$this->error('execute');return false;}foreach ($this->bind as $key => $val) {if(is_array($val)){$this->PDOStatement->bindValue($key, $val[0], $val[1]);}else{$this->PDOStatement->bindValue($key, $val);}}$this->bind =   array();$result =   $this->PDOStatement->execute();$this->debug(false);if ( false === $result) {$this->error('execute');return false;} else {$this->numRows = $this->PDOStatement->rowCount();if(preg_match("/^\s*(INSERT\s+INTO|REPLACE\s+INTO)\s+/i", $str)) {$this->lastInsID = $this->_linkID->lastInsertId();}return $this->numRows;}}/*** 启动事务* @access public* @return void*/public function startTrans() {$this->initConnect(true);if ( !$this->_linkID ) return false;//数据rollback 支持if ($this->transTimes == 0) {$this->_linkID->beginTransaction();}$this->transTimes++;return ;}/*** 用于非自动提交状态下面的查询提交* @access public* @return boolean*/public function commit() {if ($this->transTimes > 0) {$result = $this->_linkID->commit();$this->transTimes = 0;if(!$result){$this->error();return false;}}return true;}/*** 事务回滚* @access public* @return boolean*/public function rollback() {if ($this->transTimes > 0) {$result = $this->_linkID->rollback();$this->transTimes = 0;if(!$result){$this->error();return false;}}return true;}/*** 获得所有的查询数据* @access private* @return array*/private function getResult() {//返回数据集$result =   $this->PDOStatement->fetchAll(PDO::FETCH_ASSOC);$this->numRows = count( $result );return $result;}/*** 获得查询次数* @access public* @param boolean $execute 是否包含所有查询* @return integer*/public function getQueryTimes($execute=false){return $execute?$this->queryTimes+$this->executeTimes:$this->queryTimes;}/*** 获得执行次数* @access public* @return integer*/public function getExecuteTimes(){return $this->executeTimes;}/*** 关闭数据库* @access public*/public function close() {$this->_linkID = null;$this->linkID = [];return $this;}/*** 数据库错误信息* 并显示当前的SQL语句* @access public* @return string*/public function error($method='') {if($this->PDOStatement) {$error = $this->PDOStatement->errorInfo();$this->error = $error[1].':'.$error[2];}else{$this->error = '';}//2017-8-24 09:18:45 判断是否断线 增加断线重连功能if($this->isBreak($error[2]) && $method){return $this->close()->{$method}($this->queryStr);}if('' != $this->queryStr){$this->error .= "\n [ SQL语句 ] : ".$this->queryStr;}// 记录错误日志trace($this->error,'','ERR');if($this->config['debug']) {// 开启数据库调试模式E($this->error);}else{return $this->error;}}/*** 设置锁机制* @access protected* @return string*/protected function parseLock($lock=false) {return $lock?   ' FOR UPDATE '  :   '';}/*** set分析* @access protected* @param array $data* @return string*/protected function parseSet($data) {foreach ($data as $key=>$val){if(is_array($val) && 'exp' == $val[0]){$set[]  =   $this->parseKey($key).'='.$val[1];}elseif(is_null($val)){$set[]  =   $this->parseKey($key).'=NULL';}elseif(is_scalar($val)) {// 过滤非标量数据if(0===strpos($val,':') && in_array($val,array_keys($this->bind)) ){$set[]  =   $this->parseKey($key).'='.$this->escapeString($val);}else{$name   =   count($this->bind);$set[]  =   $this->parseKey($key).'=:'.$name;$this->bindParam($name,$val);}}}return ' SET '.implode(',',$set);}/*** 参数绑定* @access protected* @param string $name 绑定参数名* @param mixed $value 绑定值* @return void*/protected function bindParam($name,$value){$this->bind[':'.$name]  =   $value;}/*** 字段名分析* @access protected* @param string $key* @return string*/protected function parseKey(&$key) {return $key;}/*** value分析* @access protected* @param mixed $value* @return string*/protected function parseValue($value) {if(is_string($value)) {$value =  strpos($value,':') === 0 && in_array($value,array_keys($this->bind))? $this->escapeString($value) : '\''.$this->escapeString($value).'\'';}elseif(isset($value[0]) && is_string($value[0]) && strtolower($value[0]) == 'exp'){$value =  $this->escapeString($value[1]);}elseif(is_array($value)) {$value =  array_map(array($this, 'parseValue'),$value);}elseif(is_bool($value)){$value =  $value ? '1' : '0';}elseif(is_null($value)){$value =  'null';}return $value;}/*** field分析* @access protected* @param mixed $fields* @return string*/protected function parseField($fields) {if(is_string($fields) && '' !== $fields) {$fields    = explode(',',$fields);}if(is_array($fields)) {// 完善数组方式传字段名的支持// 支持 'field1'=>'field2' 这样的字段别名定义$array   =  array();foreach ($fields as $key=>$field){if(!is_numeric($key))$array[] =  $this->parseKey($key).' AS '.$this->parseKey($field);else$array[] =  $this->parseKey($field);}$fieldsStr = implode(',', $array);}else{$fieldsStr = '*';}//TODO 如果是查询全部字段,并且是join的方式,那么就把要查的表加个别名,以免字段被覆盖return $fieldsStr;}/*** table分析* @access protected* @param mixed $table* @return string*/protected function parseTable($tables) {if(is_array($tables)) {// 支持别名定义$array   =  array();foreach ($tables as $table=>$alias){if(!is_numeric($table))$array[] =  $this->parseKey($table).' '.$this->parseKey($alias);else$array[] =  $this->parseKey($alias);}$tables  =  $array;}elseif(is_string($tables)){$tables  =  explode(',',$tables);array_walk($tables, array(&$this, 'parseKey'));}return implode(',',$tables);}/*** where分析* @access protected* @param mixed $where* @return string*/protected function parseWhere($where) {$whereStr = '';if(is_string($where)) {// 直接使用字符串条件$whereStr = $where;}else{ // 使用数组表达式$operate  = isset($where['_logic'])?strtoupper($where['_logic']):'';if(in_array($operate,array('AND','OR','XOR'))){// 定义逻辑运算规则 例如 OR XOR AND NOT$operate    =   ' '.$operate.' ';unset($where['_logic']);}else{// 默认进行 AND 运算$operate    =   ' AND ';}foreach ($where as $key=>$val){if(is_numeric($key)){$key  = '_complex';}if(0===strpos($key,'_')) {// 解析特殊条件表达式$whereStr   .= $this->parseThinkWhere($key,$val);}else{// 查询字段的安全过滤// if(!preg_match('/^[A-Z_\|\&\-.a-z0-9\(\)\,]+$/',trim($key))){//     E(L('_EXPRESS_ERROR_').':'.$key);// }// 多条件支持$multi  = is_array($val) &&  isset($val['_multi']);$key    = trim($key);if(strpos($key,'|')) { // 支持 name|title|nickname 方式定义查询字段$array =  explode('|',$key);$str   =  array();foreach ($array as $m=>$k){$v =  $multi?$val[$m]:$val;$str[]   = $this->parseWhereItem($this->parseKey($k),$v);}$whereStr .= '( '.implode(' OR ',$str).' )';}elseif(strpos($key,'&')){$array =  explode('&',$key);$str   =  array();foreach ($array as $m=>$k){$v =  $multi?$val[$m]:$val;$str[]   = '('.$this->parseWhereItem($this->parseKey($k),$v).')';}$whereStr .= '( '.implode(' AND ',$str).' )';}else{$whereStr .= $this->parseWhereItem($this->parseKey($key),$val);}}$whereStr .= $operate;}$whereStr = substr($whereStr,0,-strlen($operate));}return empty($whereStr)?'':' WHERE '.$whereStr;}// where子单元分析protected function parseWhereItem($key,$val) {$whereStr = '';if(is_array($val)) {if(is_string($val[0])) {$exp	=	strtolower($val[0]);if(preg_match('/^(eq|neq|gt|egt|lt|elt)$/',$exp)) { // 比较运算$whereStr .= $key.' '.$this->exp[$exp].' '.$this->parseValue($val[1]);}elseif(preg_match('/^(notlike|like)$/',$exp)){// 模糊查找if(is_array($val[1])) {$likeLogic  =   isset($val[2])?strtoupper($val[2]):'OR';if(in_array($likeLogic,array('AND','OR','XOR'))){$like       =   array();foreach ($val[1] as $item){$like[] = $key.' '.$this->exp[$exp].' '.$this->parseValue($item);}$whereStr .= '('.implode(' '.$likeLogic.' ',$like).')';}}else{$whereStr .= $key.' '.$this->exp[$exp].' '.$this->parseValue($val[1]);}}elseif('bind' == $exp ){ // 使用表达式$whereStr .= $key.' = :'.$val[1];}elseif('exp' == $exp ){ // 使用表达式$whereStr .= $key.' '.$val[1];}elseif(preg_match('/^(notin|not in|in)$/',$exp)){ // IN 运算if(isset($val[2]) && 'exp'==$val[2]) {$whereStr .= $key.' '.$this->exp[$exp].' '.$val[1];}else{if(is_string($val[1])) {$val[1] =  explode(',',$val[1]);}$zone      =   implode(',',$this->parseValue($val[1]));$whereStr .= $key.' '.$this->exp[$exp].' ('.$zone.')';}}elseif(preg_match('/^(notbetween|not between|between)$/',$exp)){ // BETWEEN运算$data = is_string($val[1])? explode(',',$val[1]):$val[1];$whereStr .=  $key.' '.$this->exp[$exp].' '.$this->parseValue($data[0]).' AND '.$this->parseValue($data[1]);}else{E(L('_EXPRESS_ERROR_').':'.$val[0]);}}else {$count = count($val);$rule  = isset($val[$count-1]) ? (is_array($val[$count-1]) ? strtoupper($val[$count-1][0]) : strtoupper($val[$count-1]) ) : '' ;if(in_array($rule,array('AND','OR','XOR'))) {$count  = $count -1;}else{$rule   = 'AND';}for($i=0;$i<$count;$i++) {$data = is_array($val[$i])?$val[$i][1]:$val[$i];if('exp'==strtolower($val[$i][0])) {$whereStr .= $key.' '.$data.' '.$rule.' ';}else{$whereStr .= $this->parseWhereItem($key,$val[$i]).' '.$rule.' ';}}$whereStr = '( '.substr($whereStr,0,-4).' )';}}else {//对字符串类型字段采用模糊匹配$likeFields   =   $this->config['db_like_fields'];if($likeFields && preg_match('/^('.$likeFields.')$/i',$key)) {$whereStr .= $key.' LIKE '.$this->parseValue('%'.$val.'%');}else {$whereStr .= $key.' = '.$this->parseValue($val);}}return $whereStr;}/*** 特殊条件分析* @access protected* @param string $key* @param mixed $val* @return string*/protected function parseThinkWhere($key,$val) {$whereStr   = '';switch($key) {case '_string':// 字符串模式查询条件$whereStr = $val;break;case '_complex':// 复合查询条件$whereStr = substr($this->parseWhere($val),6);break;case '_query':// 字符串模式查询条件parse_str($val,$where);if(isset($where['_logic'])) {$op   =  ' '.strtoupper($where['_logic']).' ';unset($where['_logic']);}else{$op   =  ' AND ';}$array   =  array();foreach ($where as $field=>$data)$array[] = $this->parseKey($field).' = '.$this->parseValue($data);$whereStr   = implode($op,$array);break;}return '( '.$whereStr.' )';}/*** limit分析* @access protected* @param mixed $lmit* @return string*/protected function parseLimit($limit) {return !empty($limit)?   ' LIMIT '.$limit.' ':'';}/*** join分析* @access protected* @param mixed $join* @return string*/protected function parseJoin($join) {$joinStr = '';if(!empty($join)) {$joinStr    =   ' '.implode(' ',$join).' ';}return $joinStr;}/*** order分析* @access protected* @param mixed $order* @return string*/protected function parseOrder($order) {if(is_array($order)) {$array   =  array();foreach ($order as $key=>$val){if(is_numeric($key)) {$array[] =  $this->parseKey($val);}else{$array[] =  $this->parseKey($key).' '.$val;}}$order   =  implode(',',$array);}return !empty($order)?  ' ORDER BY '.$order:'';}/*** group分析* @access protected* @param mixed $group* @return string*/protected function parseGroup($group) {return !empty($group)? ' GROUP BY '.$group:'';}/*** having分析* @access protected* @param string $having* @return string*/protected function parseHaving($having) {return  !empty($having)?   ' HAVING '.$having:'';}/*** comment分析* @access protected* @param string $comment* @return string*/protected function parseComment($comment) {return  !empty($comment)?   ' /* '.$comment.' */':'';}/*** distinct分析* @access protected* @param mixed $distinct* @return string*/protected function parseDistinct($distinct) {return !empty($distinct)?   ' DISTINCT ' :'';}/*** union分析* @access protected* @param mixed $union* @return string*/protected function parseUnion($union) {if(empty($union)) return '';if(isset($union['_all'])) {$str  =   'UNION ALL ';unset($union['_all']);}else{$str  =   'UNION ';}foreach ($union as $u){$sql[] = $str.(is_array($u)?$this->buildSelectSql($u):$u);}return implode(' ',$sql);}/*** 参数绑定分析* @access protected* @param array $bind* @return array*/protected function parseBind($bind){$this->bind   =   array_merge($this->bind,$bind);}/*** index分析,可在操作链中指定需要强制使用的索引* @access protected* @param mixed $index* @return string*/protected function parseForce($index) {if(empty($index)) return '';if(is_array($index)) $index = join(",", $index);return sprintf(" FORCE INDEX ( %s ) ", $index);}/*** ON DUPLICATE KEY UPDATE 分析* @access protected* @param mixed $duplicate* @return string*/protected function parseDuplicate($duplicate){return '';}/*** 插入记录* @access public* @param mixed $data 数据* @param array $options 参数表达式* @param boolean $replace 是否replace* @return false | integer*/public function insert($data,$options=array(),$replace=false) {$values  =  $fields    = array();$this->model  =   $options['model'];$this->parseBind(!empty($options['bind'])?$options['bind']:array());foreach ($data as $key=>$val){if(is_array($val) && 'exp' == $val[0]){$fields[]   =  $this->parseKey($key);$values[]   =  $val[1];}elseif(is_null($val)){$fields[]   =   $this->parseKey($key);$values[]   =   'NULL';}elseif(is_scalar($val)) { // 过滤非标量数据$fields[]   =   $this->parseKey($key);if(0===strpos($val,':') && in_array($val,array_keys($this->bind))){$values[]   =   $this->parseValue($val);}else{$name       =   count($this->bind);$values[]   =   ':'.$name;$this->bindParam($name,$val);}}}// 兼容数字传入方式$replace= (is_numeric($replace) && $replace>0)?true:$replace;$sql    = (true===$replace?'REPLACE':'INSERT').' INTO '.$this->parseTable($options['table']).' ('.implode(',', $fields).') VALUES ('.implode(',', $values).')'.$this->parseDuplicate($replace);$sql    .= $this->parseComment(!empty($options['comment'])?$options['comment']:'');return $this->execute($sql,!empty($options['fetch_sql']) ? true : false);}/*** 批量插入记录* @access public* @param mixed $dataSet 数据集* @param array $options 参数表达式* @param boolean $replace 是否replace* @return false | integer*/public function insertAll($dataSet,$options=array(),$replace=false) {$values  =  array();$this->model  =   $options['model'];if(!is_array($dataSet[0])) return false;$this->parseBind(!empty($options['bind'])?$options['bind']:array());$fields =   array_map(array($this,'parseKey'),array_keys($dataSet[0]));foreach ($dataSet as $data){$value   =  array();foreach ($data as $key=>$val){if(is_array($val) && 'exp' == $val[0]){$value[]   =    $val[1];}elseif(is_null($val)){$value[]   =   'NULL';}elseif(is_scalar($val)){if(0===strpos($val,':') && in_array($val,array_keys($this->bind))){$value[]   =   $this->parseValue($val);}else{$name       =   count($this->bind);$value[]   =   ':'.$name;$this->bindParam($name,$val);}}}$values[]    = 'SELECT '.implode(',', $value);}$sql   =  'INSERT INTO '.$this->parseTable($options['table']).' ('.implode(',', $fields).') '.implode(' UNION ALL ',$values);$sql   .= $this->parseComment(!empty($options['comment'])?$options['comment']:'');return $this->execute($sql,!empty($options['fetch_sql']) ? true : false);}/*** 通过Select方式插入记录* @access public* @param string $fields 要插入的数据表字段名* @param string $table 要插入的数据表名* @param array $option  查询数据参数* @return false | integer*/public function selectInsert($fields,$table,$options=array()) {$this->model  =   $options['model'];$this->parseBind(!empty($options['bind'])?$options['bind']:array());if(is_string($fields))   $fields    = explode(',',$fields);array_walk($fields, array($this, 'parseKey'));$sql   =    'INSERT INTO '.$this->parseTable($table).' ('.implode(',', $fields).') ';$sql   .= $this->buildSelectSql($options);return $this->execute($sql,!empty($options['fetch_sql']) ? true : false);}/*** 更新记录* @access public* @param mixed $data 数据* @param array $options 表达式* @return false | integer*/public function update($data,$options) {$this->model  =   $options['model'];$this->parseBind(!empty($options['bind'])?$options['bind']:array());$table  =   $this->parseTable($options['table']);$sql   = 'UPDATE ' . $table . $this->parseSet($data);if(strpos($table,',')){// 多表更新支持JOIN操作$sql .= $this->parseJoin(!empty($options['join'])?$options['join']:'');}$sql .= $this->parseWhere(!empty($options['where'])?$options['where']:'');if(!strpos($table,',')){//  单表更新支持order和lmit$sql   .=  $this->parseOrder(!empty($options['order'])?$options['order']:'').$this->parseLimit(!empty($options['limit'])?$options['limit']:'');}$sql .=   $this->parseComment(!empty($options['comment'])?$options['comment']:'');return $this->execute($sql,!empty($options['fetch_sql']) ? true : false);}/*** 删除记录* @access public* @param array $options 表达式* @return false | integer*/public function delete($options=array()) {$this->model  =   $options['model'];$this->parseBind(!empty($options['bind'])?$options['bind']:array());$table  =   $this->parseTable($options['table']);$sql    =   'DELETE FROM '.$table;if(strpos($table,',')){// 多表删除支持USING和JOIN操作if(!empty($options['using'])){$sql .= ' USING '.$this->parseTable($options['using']).' ';}$sql .= $this->parseJoin(!empty($options['join'])?$options['join']:'');}$sql .= $this->parseWhere(!empty($options['where'])?$options['where']:'');if(!strpos($table,',')){// 单表删除支持order和limit$sql .= $this->parseOrder(!empty($options['order'])?$options['order']:'').$this->parseLimit(!empty($options['limit'])?$options['limit']:'');}$sql .=   $this->parseComment(!empty($options['comment'])?$options['comment']:'');return $this->execute($sql,!empty($options['fetch_sql']) ? true : false);}/*** 查找记录* @access public* @param array $options 表达式* @return mixed*/public function select($options=array()) {$this->model  =   $options['model'];$this->parseBind(!empty($options['bind'])?$options['bind']:array());$sql    = $this->buildSelectSql($options);$result   = $this->query($sql,!empty($options['fetch_sql']) ? true : false);return $result;}/*** 生成查询SQL* @access public* @param array $options 表达式* @return string*/public function buildSelectSql($options=array()) {if(isset($options['page'])) {// 根据页数计算limitlist($page,$listRows)   =   $options['page'];$page    =  $page>0 ? $page : 1;$listRows=  $listRows>0 ? $listRows : (is_numeric($options['limit'])?$options['limit']:20);$offset  =  $listRows*($page-1);$options['limit'] =  $offset.','.$listRows;}$sql  =   $this->parseSql($this->selectSql,$options);return $sql;}/*** 替换SQL语句中表达式* @access public* @param array $options 表达式* @return string*/public function parseSql($sql,$options=array()){$sql   = str_replace(array('%TABLE%','%DISTINCT%','%FIELD%','%JOIN%','%WHERE%','%GROUP%','%HAVING%','%ORDER%','%LIMIT%','%UNION%','%LOCK%','%COMMENT%','%FORCE%'),array($this->parseTable($options['table']),$this->parseDistinct(isset($options['distinct'])?$options['distinct']:false),$this->parseField(!empty($options['field'])?$options['field']:'*'),$this->parseJoin(!empty($options['join'])?$options['join']:''),$this->parseWhere(!empty($options['where'])?$options['where']:''),$this->parseGroup(!empty($options['group'])?$options['group']:''),$this->parseHaving(!empty($options['having'])?$options['having']:''),$this->parseOrder(!empty($options['order'])?$options['order']:''),$this->parseLimit(!empty($options['limit'])?$options['limit']:''),$this->parseUnion(!empty($options['union'])?$options['union']:''),$this->parseLock(isset($options['lock'])?$options['lock']:false),$this->parseComment(!empty($options['comment'])?$options['comment']:''),$this->parseForce(!empty($options['force'])?$options['force']:'')),$sql);return $sql;}/*** 获取最近一次查询的sql语句* @param string $model  模型名* @access public* @return string*/public function getLastSql($model='') {return $model?$this->modelSql[$model]:$this->queryStr;}/*** 获取最近插入的ID* @access public* @return string*/public function getLastInsID() {return $this->lastInsID;}/*** 获取最近的错误信息* @access public* @return string*/public function getError() {return $this->error;}/*** SQL指令安全过滤* @access public* @param string $str  SQL字符串* @return string*/public function escapeString($str) {return addslashes($str);}/*** 设置当前操作模型* @access public* @param string $model  模型名* @return void*/public function setModel($model){$this->model =  $model;}/*** 数据库调试 记录当前SQL* @access protected* @param boolean $start  调试开始标记 true 开始 false 结束*/protected function debug($start) {if($this->config['debug']) {// 开启数据库调试模式if($start) {G('queryStartTime');}else{$this->modelSql[$this->model]   =  $this->queryStr;//$this->model  =   '_think_';// 记录操作结束时间G('queryEndTime');trace($this->queryStr.' [ RunTime:'.G('queryStartTime','queryEndTime').'s ]','','SQL');}}}/*** 初始化数据库连接* @access protected* @param boolean $master 主服务器* @return void*/protected function initConnect($master=true) {if(!empty($this->config['deploy']))// 采用分布式数据库$this->_linkID = $this->multiConnect($master);else// 默认单数据库if ( !$this->_linkID ) $this->_linkID = $this->connect();}/*** 连接分布式服务器* @access protected* @param boolean $master 主服务器* @return void*/protected function multiConnect($master=false) {// 分布式数据库配置解析$_config['username']    =   explode(',',$this->config['username']);$_config['password']    =   explode(',',$this->config['password']);$_config['hostname']    =   explode(',',$this->config['hostname']);$_config['hostport']    =   explode(',',$this->config['hostport']);$_config['database']    =   explode(',',$this->config['database']);$_config['dsn']         =   explode(',',$this->config['dsn']);$_config['charset']     =   explode(',',$this->config['charset']);$m     =   floor(mt_rand(0,$this->config['master_num']-1));// 数据库读写是否分离if($this->config['rw_separate']){// 主从式采用读写分离if($master)// 主服务器写入$r  =   $m;else{if(is_numeric($this->config['slave_no'])) {// 指定服务器读$r = $this->config['slave_no'];}else{// 读操作连接从服务器$r = floor(mt_rand($this->config['master_num'],count($_config['hostname'])-1));   // 每次随机连接的数据库}}}else{// 读写操作不区分服务器$r = floor(mt_rand(0,count($_config['hostname'])-1));   // 每次随机连接的数据库}if($m != $r ){$db_master  =   array('username'  =>  isset($_config['username'][$m])?$_config['username'][$m]:$_config['username'][0],'password'  =>  isset($_config['password'][$m])?$_config['password'][$m]:$_config['password'][0],'hostname'  =>  isset($_config['hostname'][$m])?$_config['hostname'][$m]:$_config['hostname'][0],'hostport'  =>  isset($_config['hostport'][$m])?$_config['hostport'][$m]:$_config['hostport'][0],'database'  =>  isset($_config['database'][$m])?$_config['database'][$m]:$_config['database'][0],'dsn'       =>  isset($_config['dsn'][$m])?$_config['dsn'][$m]:$_config['dsn'][0],'charset'   =>  isset($_config['charset'][$m])?$_config['charset'][$m]:$_config['charset'][0],);}$db_config = array('username'  =>  isset($_config['username'][$r])?$_config['username'][$r]:$_config['username'][0],'password'  =>  isset($_config['password'][$r])?$_config['password'][$r]:$_config['password'][0],'hostname'  =>  isset($_config['hostname'][$r])?$_config['hostname'][$r]:$_config['hostname'][0],'hostport'  =>  isset($_config['hostport'][$r])?$_config['hostport'][$r]:$_config['hostport'][0],'database'  =>  isset($_config['database'][$r])?$_config['database'][$r]:$_config['database'][0],'dsn'       =>  isset($_config['dsn'][$r])?$_config['dsn'][$r]:$_config['dsn'][0],'charset'   =>  isset($_config['charset'][$r])?$_config['charset'][$r]:$_config['charset'][0],);return $this->connect($db_config,$r,$r == $m ? false : $db_master);}/*** 是否断线* 2017-8-24 09:12:40 摘自TP5 DB/Connection.php* 修改传入的参数 来适配TP3.2* @access protected* @param String  $error 返回的错误信息* @return bool*/protected function isBreak($error){$info = ['server has gone away','no connection to the server','Lost connection','is dead or not enabled','Error while sending','decryption failed or bad record mac','server closed the connection unexpectedly','SSL connection has been closed unexpectedly','Error writing data to the connection','Resource deadlock avoided',];foreach ($info as $msg) {if (false !== stripos($error, $msg)) {return true;}}return false;}/*** 析构方法* @access public*/public function __destruct() {// 释放查询if ($this->PDOStatement){$this->free();}// 关闭连接$this->close();}
}
查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. 【生活随笔】研究生如何学习

    当你上课感觉就像打酱油时,当你对研究生很迷茫时,当你坐在电脑前孜孜不倦时,请看下面的文章,很受用,至少我心里现在没有以前浮躁。好的文章有时能改变一个人的精神状态,下面就是其中之一。上海大学一位老师说:“不可否认的是,研究生面临着比较大的生存压力,但是要平衡…...

    2024/5/5 22:25:06
  2. Linux翻译软件

    词库下载http://download.huzheng.org/zh_CN/下载朗道词典 下载后,cd到下载的目录用管理员身份运行,先su一下,如果不知道su的密码输入 $ sudo passwd ,进行更改密码。然后在命令行输入一下代码,将下载好的压缩包解压并添加到stardict的文件夹里面$ tar -vjxf stardict-…...

    2024/4/24 22:51:45
  3. MYSQL搜索引擎

    一般来说,MySQL有以下几种引擎:ISAM、MyISAM、HEAP、InnoDB和Berkley(BDB)。 ISAMISAM是一个定义明确且历经时间考验的数据表格管理方法,它在设计之时就考虑到数据库被查询的次数要远大于更新的次数。因此,ISAM执行读取操作的速度很快,而且不占用大量的内存和存储资源。IS…...

    2024/4/24 22:51:44
  4. 网上悬赏帆船捉“熊猫烧香”病毒制造者

    由于“熊猫烧香”病毒的肆虐,近日,一家帆船公司在病毒侵袭资料被毁的情况下,在网上张贴出悬赏告示:任何人只要能提供有效信息捉住病毒制造者,该公司愿意赠送一艘20英尺的帆船。对于如此诱人的条件,不少网友表示质疑。律师认为个人悬赏并不违法,但必须事前签订详细合同以…...

    2024/4/24 22:51:43
  5. linux检查swoole是否安装成功

    Linux 安装Swoole练习环境:虚拟机:Oracle VM VirtualBox 5.2.4 r119785 (Qt5.6.2)。系统:CentOS Linux release 7.6.1810 (Core) x86_64-Minimal版。(1)建立一个目录放swoole的安装文件cd /datamkdir rpm2)打开swoole的github地址:https://github.com/swoole/swoole-src…...

    2024/5/6 0:37:09
  6. Android 调去照相程序拍照

    和调用图库选择图片一样,调用相机程序拍照也是经常遇到的。这里做个小总结:private void takePhoto() {// 执行拍照前应该先判断SD卡否存 String SDState = Environment.getExternalStorageState(); if (SDState.equals(Environment.MEDIA_MOUNTED)) { Intent intent = new I…...

    2024/5/6 3:26:33
  7. 常用的13个开源GIS软件,值得收藏!

    本文转载自3snews,http://news.3snews.net/2016/0721/42708.html地理信息系统(Geographic Information System,GIS)软件依赖于覆盖整个地球的数据集。为处理大量的 GIS 数据及其格式,编程人员创建了若干开源库和 GIS 套件。GIS软件以前仅限于地理学者和地质工作者使用,自从…...

    2024/5/5 22:40:30
  8. swoole 安装方法 使用即时聊天

    swoole 安装方法最近想用PHP写一个聊天网站,于是注意到了swoole这个扩展,看上它就是因为事件驱动异步非阻塞。 Swoole可以广泛应用于互联网、移动通信、企业软件、网络游戏、物联网、车联网、智能家庭等领域。 使用PHP+Swoole作为网络通信框架,可以使企业IT研发团队的效率大…...

    2024/5/5 17:08:35
  9. Linux下的AudoCAD替代软件

    Linux下的AudoCAD替代软件因为工作需要,对AutoCad做了一些了解。画2d图比较成熟的是AudoCad 2008就足够了。但是其没有Linux版本,如果要用的话估计得wine或者虚拟机了。还有就是找Ubuntu下替代软件:LibreCAD,DraftSight。看到Libre*,内心都有无限的抵触,比如它的office系…...

    2024/5/6 1:56:52
  10. 2015.03.03-忙的时候无关紧要的会议不参加,XCAP协议沟通,从WNC方案评审中的收获,BDB不作为嵌入式选择后期可能会考虑...

    今日任务:1.上午参加WNC方案评审2.下午与客户端沟通XCAP协议的开发流程3.晚上测试BDB与PHP连接操作实际:1.上午参加WNC方案评审 感觉浪费时间,以后不参加这类会议2.下午与客户端沟通XCAP协议的开发流程 完成3.晚上测试BDB与PHP连接操作 BDB与PHP连接不太友好,windows和linu…...

    2024/4/24 22:51:41
  11. 我的四年大学生活总结

    序2013年夏末,我来到了天津大学,开始为期四年的大学本科学习与生活。在中学时代其实对大学是非常憧憬和向往的,最终在天大的软件学院软件工程系开启了这段对人生十分重要的岁月。 四年之后,在即将进入职场之际,写下此文,纪念我的四年大学生活。大一,起点高中最后一年我…...

    2024/4/24 22:51:37
  12. 新病毒仿"熊猫烧香" 利用 Vista系统漏洞疯狂传播

    3月31日,瑞星全球反病毒监测网截获一个与“熊猫烧香”非常相似的高危病毒,命名为“ANI蠕虫(Worm.DlOnlineGames.a)”。该病毒不光传播和危害方式与“熊猫烧香”病毒非常相似,还利用了上周末才刚出现的Vista、XP等操作系统的ANI高危漏洞。根据瑞星客户服务中心的统计,短短…...

    2024/4/14 21:31:01
  13. 玩转Windows下40款开源软件

    这是国外较有影响的网站于2007年9月8日发布的新文章,算是windows下20款开源软件的续篇。发出不久,digg数已上千。xbeta进行简译,以便于国内用户在免费软件方面有更多选择。 信息安全这是国外较有影响的网站于2007年9月8日发布的新文章,算是windows下20款开源软件的续篇。发…...

    2024/4/14 21:31:00
  14. 给大家推荐一个很好的免费学习资源下载网站—软实力资源网

    最近浏览网页时发现了一个很不错的资料下载网站--软实力资源网www.sp8848.com,与大家一起分享一下: <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 主要栏目:【 成功学院 】 成功学 NLP心理学 创业财商 人际关系 沟通演…...

    2024/4/14 21:30:59
  15. [转载]图文并茂介绍在VS2010里使用TFS2010

    [转载]图文并茂介绍在VS2010里使用TFS2010现在我们来讲一下如何在VS2010里面创建项目并添加到TFS2010里面。 新建一个项目,并把它添加到TFS,我们会收到下面的错误:这是因为我们没有为项目创建Team project,而把它直接添加到了Team project collections,这是不允许的。下面我…...

    2024/4/19 21:23:40
  16. Berkeley DB 的简介

    1. Berkeley DB BDB是一个通用的嵌入式数据库引擎,能够提供丰富的数据管理服务。它的设计目标是为了解决数据的高吞吐量,高效的数据访问。BDB可以优雅管理几个字节扩展到TB级的数据量。在大多数情况下,BDB是有上限的,他依赖于系统的可用物理资源。 因为BDB是一个嵌入式数…...

    2024/4/24 22:51:43
  17. Swoole实战代码笔记

    Swoole入门到实战代码笔记 一部分是我去年在慕课网买的丝袜老师的视频教程,学完之后根据自己的理解和在其他地方学到的东西整理出来的笔记. 一部分是之前项目中用到和学到的东西. swoole基于docker时要用到的初始化环境 更换163源 apt-get -y clean\&& echo "deb …...

    2024/4/24 22:51:34
  18. 通过程序自动向 TFS 2010 中添加 WorkItem

    如果需要通过代码自动向 TFS 2010 中添加 或者更改 WorkItem,则可以使用下面的代码:using System; using System.Collections.Generic; using System.Text; using Microsoft.TeamFoundation.Client; using Microsoft.TeamFoundation.WorkItemTracking.Client;namespace Impor…...

    2024/4/24 22:51:34
  19. swoole_event_add实现异步

    swoole提供了swoole_event_add函数,可以实现异步。此函数可以用在Server或Client模式下。swoole_event_add属于AsyncIO,必须运行在CLI 模式。异步tcp客户端 stream_socket_client实现tcp同步客户端 示例: <?php$start_time = microtime(TRUE);$fp = stream_socket_clien…...

    2024/4/24 22:51:33
  20. 熊猫烧香QQ表情包

    还记得熊猫烧香病毒刚出来时,有访客朋友说“好可爱啊,上哪去下载它啊”.如今我们在网上搜集到了一套熊猫烧香表情图片,做成了QQ表情安装包.如果您喜欢,欢迎下载.(原始表情文件也打包在一起,使用其他IM的朋友也可以下载使用)一共有28个,预览两个:转载于:https://blog.51cto.co…...

    2024/4/24 22:51:31

最新文章

  1. 推荐网站(1)懒人Excel,函数公式、操作技巧等,一看就看会

    相信很多小伙伴打开excel表的时候&#xff0c;不知道要怎么操作&#xff0c;也不知道该如何搜索自己想要的结果&#xff0c;那么我推荐个网站懒人Excel&#xff0c;它可以帮我们快速了解使用 EXCEL的基本操作&#xff0c;也可以帮我们解决使用 EXCEL的遇到的问题。 可以看到他…...

    2024/5/6 3:41:08
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. Nginx配置文件修改结合内网穿透实现公网访问多个本地web站点

    文章目录 1. 下载windows版Nginx2. 配置Nginx3. 测试局域网访问4. cpolar内网穿透5. 测试公网访问6. 配置固定二级子域名7. 测试访问公网固定二级子域名 1. 下载windows版Nginx 进入官方网站(http://nginx.org/en/download.html)下载windows版的nginx 下载好后解压进入nginx目…...

    2024/5/5 0:23:44
  4. Linux从入门到精通 --- 2.基本命令入门

    文章目录 第二章&#xff1a;2.1 Linux的目录结构2.1.1 路径描述方式 2.2 Linux命令入门2.2.1 Linux命令基础格式2.2.2 ls命令2.2.3 ls命令的参数和选项2.2.4 ls命令选项的组合使用 2.3 目录切换相关命令2.3.1 cd切换工作目录2.3.2 pwd查看当前工作目录2.4 相对路径、绝对路径和…...

    2024/5/5 8:36:18
  5. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/5/4 23:54:56
  6. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/5/4 23:54:56
  7. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/5/4 23:54:56
  8. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/5/4 23:55:17
  9. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/5/4 23:54:56
  10. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/5/4 23:55:05
  11. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/5/4 23:54:56
  12. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/5/4 23:55:16
  13. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/5/4 23:54:56
  14. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/5/6 1:40:42
  15. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/5/4 23:54:56
  16. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/5/4 23:55:17
  17. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/5/4 23:55:06
  18. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/5/4 23:54:56
  19. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/5/4 23:55:06
  20. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/5/5 8:13:33
  21. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/5/4 23:55:16
  22. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/5/4 23:54:58
  23. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/5/4 23:55:01
  24. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/5/4 23:54:56
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57