ecshop适应在php7,ecshop适应PHP7的解决方法

if (!defined('DITAN_ECS'))

{

die('Hacking attempt');

}

class cls_mysql

{

var $link_id    = NULL;

var $settings   = array();

var $queryCount = 0;

var $queryTime  = '';

var $queryLog   = array();

var $max_cache_time = 300; // 最大的缓存时间,以秒为单位

var $cache_data_dir = 'temp/query_caches/';

var $root_path      = '';

var $error_message  = array();

var $platform       = '';

var $version        = '';

var $dbhash         = '';

var $starttime      = 0;

var $timeline       = 0;

var $timezone       = 0;

// 事务指令数

protected $transTimes = 0;

var $mysql_config_cache_file_time = 0;

var $mysql_disable_cache_tables = array(); // 不允许被缓存的表,遇到将不会进行缓存

function __construct($dbhost, $dbuser, $dbpw, $dbname = '', $charset = 'gbk', $pconnect = 0, $quiet = 0)

{

$this->cls_mysql($dbhost, $dbuser, $dbpw, $dbname, $charset, $pconnect, $quiet);

}

function cls_mysql($dbhost, $dbuser, $dbpw, $dbname = '', $charset = 'gbk', $pconnect = 0, $quiet = 0)

{

if (defined('EC_CHARSET'))

{

$charset = strtolower(str_replace('-', '', EC_CHARSET));

}

if (defined('ROOT_PATH') && !$this->root_path)

{

$this->root_path = ROOT_PATH;

}

if ($quiet)

{

$this->connect($dbhost, $dbuser, $dbpw, $dbname, $charset, $pconnect, $quiet);

}

else

{

$this->settings = array(

'dbhost'   => $dbhost,

'dbuser'   => $dbuser,

'dbpw'     => $dbpw,

'dbname'   => $dbname,

'charset'  => $charset,

'pconnect' => $pconnect

);

}

}

function connect($dbhost, $dbuser, $dbpw, $dbname = '', $charset = 'utf8', $pconnect = 0, $quiet = 0)

{

if ($pconnect)

{

$this->link_id = new mysqli('p:'.$dbhost, $dbuser, $dbpw);

if ($this->link_id->connect_error)

{

if (!$quiet)

{

$this->ErrorMsg("Can't pConnect MySQL Server($dbhost)!");

}

return false;

}

}

else

{

$this->link_id = new mysqli($dbhost, $dbuser, $dbpw);

if ($this->link_id->connect_error)

{

if (!$quiet)

{

$this->ErrorMsg("Can't Connect MySQL Server($dbhost)!");

}

return false;

}

}

$this->dbhash  = md5($this->root_path . $dbhost . $dbuser . $dbpw . $dbname);

$this->version = $this->link_id->server_version;

/* 对字符集进行初始化 */

$this->link_id->set_charset($charset);

$this->link_id->query("SET sql_mode=''");

$sqlcache_config_file = $this->root_path . $this->cache_data_dir . 'sqlcache_config_file_' . $this->dbhash . '.php';

@include($sqlcache_config_file);

$this->starttime = time();

if ($this->max_cache_time && $this->starttime > $this->mysql_config_cache_file_time + $this->max_cache_time)

{

if ($dbhost != '.')

{

$result = $this->link_id->query("SHOW VARIABLES LIKE 'basedir'");

$row = $result->fetch_array(MYSQLI_ASSOC);

$result->free();

if (!empty($row['Value']{1}) && $row['Value']{1} == ':' && !empty($row['Value']{2}) && $row['Value']{2} == "/")

{

$this->platform = 'WINDOWS';

}

else

{

$this->platform = 'OTHER';

}

}

else

{

$this->platform = 'WINDOWS';

}

if ($this->platform == 'OTHER' &&

($dbhost != '.' && strtolower($dbhost) != 'localhost:3306' && $dbhost != '127.0.0.1:3306') ||

date_default_timezone_get() == 'UTC')

{

$result = $this->link_id->query("SELECT UNIX_TIMESTAMP() AS timeline, UNIX_TIMESTAMP('" . date('Y-m-d H:i:s', $this->starttime) . "') AS timezone");

$row = $result->fetch_array(MYSQLI_ASSOC);

$result->free();

if ($dbhost != '.' && strtolower($dbhost) != 'localhost:3306' && $dbhost != '127.0.0.1:3306')

{

$this->timeline = $this->starttime - $row['timeline'];

}

if (date_default_timezone_get() == 'UTC')

{

$this->timezone = $this->starttime - $row['timezone'];

}

}

$content = '

'$this->mysql_config_cache_file_time = ' . $this->starttime . ";\r\n" .

'$this->timeline = ' . $this->timeline . ";\r\n" .

'$this->timezone = ' . $this->timezone . ";\r\n" .

'$this->platform = ' . "'" . $this->platform . "';\r\n?" . '>';

@file_put_contents($sqlcache_config_file, $content);

}

/* 选择数据库 */

if ($dbname)

{

if ($this->link_id->select_db($dbname) === false )

{

if (!$quiet)

{

$this->ErrorMsg("Can't select MySQL database($dbname)!");

}

return false;

}

else

{

return true;

}

}

else

{

return true;

}

}

function select_database($dbname)

{

return $this->link_id->select_db($dbname);

}

function set_mysql_charset($charset)

{

if (in_array(strtolower($charset), array('gbk', 'big5', 'utf-8', 'utf8')))

{

$charset = str_replace('-', '', $charset);

}

$this->link_id->set_charset($charset);

}

function fetch_array($query, $result_type = MYSQLI_ASSOC)

{

$row = $query->fetch_array($result_type);

$query->free();

return $row;

}

function query($sql, $type = '')

{

if ($this->link_id === NULL)

{

$this->connect($this->settings['dbhost'], $this->settings['dbuser'], $this->settings['dbpw'], $this->settings['dbname'], $this->settings['charset'], $this->settings['pconnect']);

$this->settings = array();

}

if ($this->queryCount++ <= 99)

{

$this->queryLog[] = $sql;

}

if ($this->queryTime == '')

{

if (PHP_VERSION >= '5.0.0')

{

$this->queryTime = microtime(true);

}

else

{

$this->queryTime = microtime();

}

}

/* 当当前的时间大于类初始化时间的时候,自动执行 ping 这个自动重新连接操作 */

if (time() > $this->starttime + 1)

{

$this->link_id->ping();

}

if (!($query = $this->link_id->query($sql)) && $type != 'SILENT')

{

$this->error_message[]['message'] = 'MySQL Query Error';

$this->error_message[]['sql'] = $sql;

$this->error_message[]['error'] = $this->link_id->error;

$this->error_message[]['errno'] = $this->link_id->errno;

$this->ErrorMsg();

return false;

}

if (defined('DEBUG_MODE') && (DEBUG_MODE & 8) == 8)

{

$logfilename = $this->root_path . DATA_DIR . '/mysql_query_' . $this->dbhash . '_' . date('Y_m_d') . '.log';

$str = $sql . "\n\n";

if (PHP_VERSION >= '5.0')

{

file_put_contents($logfilename, $str, FILE_APPEND);

}

else

{

$fp = @fopen($logfilename, 'ab+');

if ($fp)

{

fwrite($fp, $str);

fclose($fp);

}

}

}

return $query;

}

function affected_rows()

{

return $this->link_id->affected_rows;

}

function error()

{

return $this->link_id->error;

}

function errno()

{

return $this->link_id->errno;

}

function result($query, $row)

{

$query->data_seek($row);

$result = $query->fetch_row();

$query->free();

return $result;

}

function num_rows($query)

{

return $query->num_rows;

}

function num_fields($query)

{

return $this->link_id->field_count;

}

function free_result($query)

{

return $query->free();

}

function insert_id()

{

return $this->link_id->insert_id;

}

function fetchRow($query)

{

return $query->fetch_assoc();

}

function fetch_fields($query)

{

return $query->fetch_field();

}

function version()

{

return $this->version;

}

function ping()

{

return $this->link_id->ping();

}

function escape_string($unescaped_string)

{

return $this->link_id->real_escape_string($unescaped_string);

}

function close()

{

return $this->link_id->close();

}

function ErrorMsg($message = '', $sql = '')

{

if ($message)

{

echo "DTXB info: $message\n\n
";

//print('http://faq.comsenz.com/');

}

else

{

echo "MySQL server error report:";

print_r($this->error_message);

//echo "error_message[2]['error']) . "' target='_blank'>http://faq.comsenz.com/";

}

exit;

}

/* 仿真 Adodb 函数 */

function selectLimit($sql, $num, $start = 0)

{

if ($start == 0)

{

$sql .= ' LIMIT ' . $num;

}

else

{

$sql .= ' LIMIT ' . $start . ', ' . $num;

}

return $this->query($sql);

}

function getOne($sql, $limited = false)

{

if ($limited == true)

{

$sql = trim($sql . ' LIMIT 1');

}

$res = $this->query($sql);

if ($res !== false)

{

$row = $res->fetch_row();

$res->free();

if ($row !== false)

{

return $row[0];

}

else

{

return '';

}

}

else

{

return false;

}

}

function getOneCached($sql, $cached = 'FILEFIRST')

{

$sql = trim($sql . ' LIMIT 1');

$cachefirst = ($cached == 'FILEFIRST' || ($cached == 'MYSQLFIRST' && $this->platform != 'WINDOWS')) && $this->max_cache_time;

if (!$cachefirst)

{

return $this->getOne($sql, true);

}

else

{

$result = $this->getSqlCacheData($sql, $cached);

if (empty($result['storecache']) == true)

{

return $result['data'];

}

}

$arr = $this->getOne($sql, true);

if ($arr !== false && $cachefirst)

{

$this->setSqlCacheData($result, $arr);

}

return $arr;

}

function getAll($sql)

{

$res = $this->query($sql);

if ($res !== false)

{

$arr = $res->fetch_all(MYSQLI_ASSOC);

$res->free();

return $arr;

}

else

{

return false;

}

}

function getAllCached($sql, $cached = 'FILEFIRST')

{

$cachefirst = ($cached == 'FILEFIRST' || ($cached == 'MYSQLFIRST' && $this->platform != 'WINDOWS')) && $this->max_cache_time;

if (!$cachefirst)

{

return $this->getAll($sql);

}

else

{

$result = $this->getSqlCacheData($sql, $cached);

if (empty($result['storecache']) == true)

{

return $result['data'];

}

}

$arr = $this->getAll($sql);

if ($arr !== false && $cachefirst)

{

$this->setSqlCacheData($result, $arr);

}

return $arr;

}

function getRow($sql, $limited = false)

{

if ($limited == true)

{

$sql = trim($sql . ' LIMIT 1');

}

$res = $this->query($sql);

if ($res !== false)

{

$result = $res->fetch_assoc();

$res->free();

return $result;

}

else

{

return false;

}

}

function getRowCached($sql, $cached = 'FILEFIRST')

{

$cachefirst = ($cached == 'FILEFIRST' || ($cached == 'MYSQLFIRST' && $this->platform != 'WINDOWS')) && $this->max_cache_time;

if (!$cachefirst)

{

return $this->getRow($sql, true);

}

else

{

$result = $this->getSqlCacheData($sql, $cached);

if (empty($result['storecache']) == true)

{

return $result['data'];

}

}

$arr = $this->getRow($sql, true);

if ($arr !== false && $cachefirst)

{

$this->setSqlCacheData($result, $arr);

}

return $arr;

}

function getCol($sql)

{

$res = $this->query($sql);

if ($res !== false)

{

$arr = array();

while ($row = $res->fetch_row())

{

$arr[] = $row[0];

}

$res->free();

return $arr;

}

else

{

return false;

}

}

function getColCached($sql, $cached = 'FILEFIRST')

{

$cachefirst = ($cached == 'FILEFIRST' || ($cached == 'MYSQLFIRST' && $this->platform != 'WINDOWS')) && $this->max_cache_time;

if (!$cachefirst)

{

return $this->getCol($sql);

}

else

{

$result = $this->getSqlCacheData($sql, $cached);

if (empty($result['storecache']) == true)

{

return $result['data'];

}

}

$arr = $this->getCol($sql);

if ($arr !== false && $cachefirst)

{

$this->setSqlCacheData($result, $arr);

}

return $arr;

}

function autoExecute($table, $field_values, $mode = 'INSERT', $where = '', $querymode = '')

{

$field_names = $this->getCol('DESC ' . $table);

$sql = '';

if ($mode == 'INSERT')

{

$fields = $values = array();

foreach ($field_names AS $value)

{

if (array_key_exists($value, $field_values) == true)

{

$fields[] = $value;

$values[] = "'" . $field_values[$value] . "'";

}

}

if (!empty($fields))

{

$sql = 'INSERT INTO ' . $table . ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';

}

}

else

{

$sets = array();

foreach ($field_names AS $value)

{

if (array_key_exists($value, $field_values) == true)

{

$sets[] = $value . " = '" . $field_values[$value] . "'";

}

}

if (!empty($sets))

{

$sql = 'UPDATE ' . $table . ' SET ' . implode(', ', $sets) . ' WHERE ' . $where;

}

}

if ($sql)

{

return $this->query($sql, $querymode);

}

else

{

return false;

}

}

function autoReplace($table, $field_values, $update_values, $where = '', $querymode = '')

{

$field_descs = $this->getAll('DESC ' . $table);

$primary_keys = array();

foreach ($field_descs AS $value)

{

$field_names[] = $value['Field'];

if ($value['Key'] == 'PRI')

{

$primary_keys[] = $value['Field'];

}

}

$fields = $values = array();

foreach ($field_names AS $value)

{

if (array_key_exists($value, $field_values) == true)

{

$fields[] = $value;

$values[] = "'" . $field_values[$value] . "'";

}

}

$sets = array();

foreach ($update_values AS $key => $value)

{

if (array_key_exists($key, $field_values) == true)

{

if (is_int($value) || is_float($value))

{

$sets[] = $key . ' = ' . $key . ' + ' . $value;

}

else

{

$sets[] = $key . " = '" . $value . "'";

}

}

}

$sql = '';

if (empty($primary_keys))

{

if (!empty($fields))

{

$sql = 'INSERT INTO ' . $table . ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';

}

}

else

{

if ($this->version() >= '4.1')

{

if (!empty($fields))

{

$sql = 'INSERT INTO ' . $table . ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';

if (!empty($sets))

{

$sql .=  'ON DUPLICATE KEY UPDATE ' . implode(', ', $sets);

}

}

}

else

{

if (empty($where))

{

$where = array();

foreach ($primary_keys AS $value)

{

if (is_numeric($value))

{

$where[] = $value . ' = ' . $field_values[$value];

}

else

{

$where[] = $value . " = '" . $field_values[$value] . "'";

}

}

$where = implode(' AND ', $where);

}

if ($where && (!empty($sets) || !empty($fields)))

{

if (intval($this->getOne("SELECT COUNT(*) FROM $table WHERE $where")) > 0)

{

if (!empty($sets))

{

$sql = 'UPDATE ' . $table . ' SET ' . implode(', ', $sets) . ' WHERE ' . $where;

}

}

else

{

if (!empty($fields))

{

$sql = 'REPLACE INTO ' . $table . ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')';

}

}

}

}

}

if ($sql)

{

return $this->query($sql, $querymode);

}

else

{

return false;

}

}

function setMaxCacheTime($second)

{

$this->max_cache_time = $second;

}

function getMaxCacheTime()

{

return $this->max_cache_time;

}

function getSqlCacheData($sql, $cached = '')

{

$sql = trim($sql);

$result = array();

$result['filename'] = $this->root_path . $this->cache_data_dir . 'sqlcache_' . abs(crc32($this->dbhash . $sql)) . '_' . md5($this->dbhash . $sql) . '.php';

$data = @file_get_contents($result['filename']);

if (isset($data{23}))

{

$filetime = substr($data, 13, 10);

$data     = substr($data, 23);

if (($cached == 'FILEFIRST' && time() > $filetime + $this->max_cache_time) || ($cached == 'MYSQLFIRST' && $this->table_lastupdate($this->get_table_name($sql)) > $filetime))

{

$result['storecache'] = true;

}

else

{

$result['data'] = @unserialize($data);

if ($result['data'] === false)

{

$result['storecache'] = true;

}

else

{

$result['storecache'] = false;

}

}

}

else

{

$result['storecache'] = true;

}

return $result;

}

function setSqlCacheData($result, $data)

{

if ($result['storecache'] === true && $result['filename'])

{

@file_put_contents($result['filename'], '<?php exit;?>' . time() . serialize($data));

clearstatcache();

}

}

/* 获取 SQL 语句中最后更新的表的时间,有多个表的情况下,返回最新的表的时间 */

function table_lastupdate($tables)

{

if ($this->link_id === NULL)

{

$this->connect($this->settings['dbhost'], $this->settings['dbuser'], $this->settings['dbpw'], $this->settings['dbname'], $this->settings['charset'], $this->settings['pconnect']);

$this->settings = array();

}

$lastupdatetime = '0000-00-00 00:00:00';

$tables = str_replace('`', '', $tables);

$this->mysql_disable_cache_tables = str_replace('`', '', $this->mysql_disable_cache_tables);

foreach ($tables AS $table)

{

if (in_array($table, $this->mysql_disable_cache_tables) == true)

{

$lastupdatetime = '2037-12-31 23:59:59';

break;

}

if (strstr($table, '.') != NULL)

{

$tmp = explode('.', $table);

$sql = 'SHOW TABLE STATUS FROM `' . trim($tmp[0]) . "` LIKE '" . trim($tmp[1]) . "'";

}

else

{

$sql = "SHOW TABLE STATUS LIKE '" . trim($table) . "'";

}

$result = $this->link_id->query($sql);

$row = $result->fetch_assoc();

if ($row['Update_time'] > $lastupdatetime)

{

$lastupdatetime = $row['Update_time'];

}

}

$lastupdatetime = strtotime($lastupdatetime) - $this->timezone + $this->timeline;

return $lastupdatetime;

}

function get_table_name($query_item)

{

$query_item = trim($query_item);

$table_names = array();

/* 判断语句中是不是含有 JOIN */

if (stristr($query_item, ' JOIN ') == '')

{

/* 解析一般的 SELECT FROM 语句 */

if (preg_match('/^SELECT.*?FROM\s*((?:`?\w+`?\s*\.\s*)?`?\w+`?(?:(?:\s*AS)?\s*`?\w+`?)?(?:\s*,\s*(?:`?\w+`?\s*\.\s*)?`?\w+`?(?:(?:\s*AS)?\s*`?\w+`?)?)*)/is', $query_item, $table_names))

{

$table_names = preg_replace('/((?:`?\w+`?\s*\.\s*)?`?\w+`?)[^,]*/', '\1', $table_names[1]);

return preg_split('/\s*,\s*/', $table_names);

}

}

else

{

/* 对含有 JOIN 的语句进行解析 */

if (preg_match('/^SELECT.*?FROM\s*((?:`?\w+`?\s*\.\s*)?`?\w+`?)(?:(?:\s*AS)?\s*`?\w+`?)?.*?JOIN.*$/is', $query_item, $table_names))

{

$other_table_names = array();

preg_match_all('/JOIN\s*((?:`?\w+`?\s*\.\s*)?`?\w+`?)\s*/i', $query_item, $other_table_names);

return array_merge(array($table_names[1]), $other_table_names[1]);

}

}

return $table_names;

}

/* 设置不允许进行缓存的表 */

function set_disable_cache_tables($tables)

{

if (!is_array($tables))

{

$tables = explode(',', $tables);

}

foreach ($tables AS $table)

{

$this->mysql_disable_cache_tables[] = $table;

}

array_unique($this->mysql_disable_cache_tables);

}

/**

+----------------------------------------------------------

* 启动事务

+----------------------------------------------------------

* @access public

+----------------------------------------------------------

* @return void

+----------------------------------------------------------

*/

public function startTrans() {

//$this->initConnect(true);

if ( !$this->link_id ) return false;

//数据rollback 支持

if ($this->transTimes == 0) {

$this->link_id->autocommit(FALSE);

}

$this->transTimes++;

return ;

}

/**

+----------------------------------------------------------

* 用于非自动提交状态下面的查询提交

+----------------------------------------------------------

* @access public

+----------------------------------------------------------

* @return boolen

+----------------------------------------------------------

*/

public function commit()

{

if ($this->transTimes > 0) {

$result = $this->link_id->commit();

$this->transTimes = 0;

if(!$result){

$this->error_message[]['message'] = 'MySQL Query Error';

$this->error_message[]['sql'] = $sql;

$this->error_message[]['error'] = $this->link_id->error;

$this->error_message[]['errno'] = $this->link_id->errno;

$this->ErrorMsg();

return false;

}

}

return true;

}

/**

+----------------------------------------------------------

* 事务回滚

+----------------------------------------------------------

* @access public

+----------------------------------------------------------

* @return boolen

+----------------------------------------------------------

*/

public function rollback()

{

if ($this->transTimes > 0) {

$result = $this->link_id->rollback();

$this->transTimes = 0;

if(!$result){

$this->error_message[]['message'] = 'MySQL Query Error';

$this->error_message[]['sql'] = $sql;

$this->error_message[]['error'] = $this->link_id->error;

$this->error_message[]['errno'] = $this->link_id->errno;

$this->ErrorMsg();

return false;

}

}

return true;

}

}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/506353.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

angular 字符串转换成数字_Angular日期在TypeScript中格式化转换应用

组件模板中我们常常使用Angular内置管道DatePipe将其日期格式化&#xff0c;如同{{ startTime | date:yyyy-MM-dd }}这般操作&#xff0c;即可转换为字符串格式。那么在TS文件中我们也可以通过DatePipe或formatDate方法将其格式化。Angular日期在TypeScript中格式化转换应用​w…

python罗马数字转换,Python3.5实现的罗马数字转换成整数功能示例

本文实例讲述了Python3.5实现的罗马数字转换成整数功能。分享给大家供大家参考&#xff0c;具体如下&#xff1a;问题概述&#xff1a;给定一个罗马数字 &#xff0c;将罗马数字转换成整数。如罗马数字I&#xff0c;II&#xff0c;III&#xff0c;IV&#xff0c;V分别代表数字 …

js在一个指定元素前添加内容_WebAR开发指南(1)---使用AR.js实现第一个WebAR demo...

前面有一篇文章万字干货介绍WebAR的实现与应用 分析了目前流行的WebAR框架并简单的介绍一些实现方法&#xff0c;这个专栏我们具体的来通过一些框架实现WebAR效果。关于AR.jsAR.js是一个轻量级的增强现实类JavaScript库&#xff0c;支持基于标记和位置的增强现实。开发人员可以…

php基础教学笔记,php学习笔记:基础知识

php学习笔记&#xff1a;基础知识2.每行结尾不允许有多余的空格3.确保文件的命名和调用大小写一致&#xff0c;是由于类Unix系统上面&#xff0c;对大小写是敏感的4.方法名只允许由字母组成&#xff0c;下划线是不允许的&#xff0c;首字母要小写&#xff0c;其后每个单词首字母…

视图编辑php,PhpStorm视图模式

# PhpStorm视图模式在这个页面中&#xff1a;* [基础](#基础)* [切换全屏模式](#切换全屏模式)* [切换演示模式](#切换演示模式)* [切换不分心模式](#切换不分心模式)## 基础PhpStorm提供特定的视图模式&#xff1a;* **全屏模式** 允许你使用整个屏幕编写代码&#xff0c;在视…

python 最小二乘回归 高斯核_从简单数学建模开始:08最小二乘准则的应用(附python代码)...

模型拟合一般来说有这么三种&#xff1a;切比雪夫近似准则极小化绝对偏差之和最小二乘准则这几个原则各有各的适用范围。其中最小二乘准则是比较容易计算的。接下来我将简要的介绍最小二乘准则以及举例说明如何用python实现。最小二乘准则定义&#xff1a;给定某种函数类型 和 …

oracle 时间集合,oracle 日期函数集合(集中版本)第2/2页

oracle 日期函数集合(集中版本)第2/2页更新时间&#xff1a;2009年06月16日 23:45:55 作者&#xff1a;oracle 日期函数网上已经有了不少&#xff0c;特我们跟集中一下&#xff0c;免得大家麻烦。一、 常用日期数据格式1.Y或YY或YYY 年的最后一位&#xff0c;两位或三位SQL&g…

中缀表达式转后缀表达式两位数_再见,正则表达式!

从一段指定的字符串中&#xff0c;取得期望的数据&#xff0c;正常人都会想到正则表达式吧&#xff1f;写过正则表达式的人都知道&#xff0c;正则表达式入门不难&#xff0c;写起来也容易。但是正则表达式几乎没有可读性可言&#xff0c;维护起来&#xff0c;真的会让人抓狂&a…

asp连oracle测试,ASP连接Oracle

ASP连接Oracle的方式有几种, 这里介绍一下 OLE 连接方法dim objConn,strConn,DBServer,DBName,DBUser,DBPassworddim RS,xSQLDBServer"192.168.1.151" //DB ServerDBName"oracleDB" //登陆数据库名/SIDDBUser"system" //登陆用户名DBPassword&qu…

php 腾讯云 文字识别_腾讯科技(成都)有限公司

成都IT内推圈是由IT行业老兵组建的民间组织&#xff0c;我们希望能为广大IT同仁提供力所能及的帮助&#xff0c;我们不仅提供靠谱的职位&#xff0c;我们更是有温度的圈子&#xff01;为了帮助更多的朋友寻找到靠谱的内推职位&#xff0c;老农在此号召大家&#xff1a;1. 发布职…

oracle插入性能优化,Oracle- insert性能优化

看见朋友导入数据&#xff0c;花了很长时间都没完成&#xff01;其实有很多快速的方法&#xff0c;整理下&#xff01;向表中插入数据有很多办法,但是方法不同&#xff0c;性能差别很大.----1.原始语句drop table t1 purge;create table t1(sid number,sname varchar2(20)) tab…

winscp 自动断开无法连接_winscp教程,winscp教程,看完就学会的winscp教程

作为一个站长&#xff0c;当你的网站流量逐渐变大时&#xff0c;就会发现目前的主机无法满足正常需要&#xff0c;就要更换更高一级的云主机或VPS主机&#xff0c;新手就需要使用WinSCP和Putty&#xff0c;来管理主机。IIS7服务器管理工具可以批量管理、定时上传下载、同步操作…

oracle客户端数据恢复,AnyBackup-Oracle 数据恢复任务恢复到异客户端失败,并提示错误:数据源为空,请检查恢复环境是否授权...

关键字Oracle、数据源适用产品AnyBackup Express 7.0.6 - 7.0.8AnyBackup CDM 7.0.6 - 7.0.8问题描述登录 AnyBackup 管理控制台&#xff0c;依次点击定时数据保护 > 数据恢复 > 新建&#xff0c;新建 Oracle 数据恢复任务&#xff0c;选择恢复数据到异客户端&#xff0c…

python创建excel_python自动生成excel(xlwt库)

# coding: utf-8import web import json import datetime import xlwt import StringIO # 如果不在前端调用接口&#xff0c;如下web.py框架的urls和app、render可以省略 urls( # web框架的路由/index,Index,/home,Home, ) appweb.aplication(urls, globals()) # 注册应用 rend…

linux限制单个用户使用,linux下限制用户使用系统资源

linux下限制用户使用系统资源除了可以对用户设置磁盘配额以及权限做限制以外还可以使用ulimit可以对所有用户的core文件大小&#xff0c;数据段大小&#xff0c;最多可使用的CPU事件和最多可打开的文件数目等做限制&#xff0c;将ulimit命令放在/etc/profile文件中&#xff0c;…

linux祖先进程,Linux下的几种特殊进程

1、Linux的登录环境Linux是一个多任务多用户的操作系统&#xff0c;其设计初衷: 就是要达成多用户同时使用单个计算机大的任务。多用户&#xff1a;早期计算机资源紧张&#xff0c;为了让更多的人都可以使用。多任务&#xff1a;服务于多用户&#xff0c;同时提高计算机的吞吐量…

@select注解_SSM框架(十三):Spring框架中的IoC(3)新注解,完全摆脱xml文件

spring中的新注解1、Configuration作用&#xff1a;指定当前类是一个配置类细节&#xff1a;当配置类作为AnnotationConfigApplicationContext对象创建的参数时&#xff0c;该注解可以不写。2、ComponentScan作用&#xff1a;用于通过注解指定spring在创建容器时要扫描的包属性…

linux 到文件的最后一行,linux – 将第一行复制到文件中的最后一行

这里的目的是将文件中的第一行复制到最后一行这里是输入文件335418.75,2392631.25,36091,38466,1335418.75,2392643.75,36092,38466,1335418.75,2392656.25,36093,38466,1335418.75,2392668.75,36094,38466,1335418.75,2392681.25,36095,38466,1335418.75,2392693.75,36096,384…

element ui 多个子组件_ElementUI 技术揭秘(2) 组件库的整体设计

需求分析当我们去实现一个组件库的时候&#xff0c;并不会一上来就撸码&#xff0c;而是把它当做产品一样&#xff0c;思考一下我们的组件库的需求。那么对于 element-ui&#xff0c;除了基于 Vue.js 技术栈开发组件&#xff0c;它还有哪些方面的需求呢。丰富的 feature&#x…

LinuX编译显示内核配置无效,配置编译内核(Linux kernel)

虽然以前也编译过内核&#xff0c;但是关于内核配置选项特别是有关本机驱动这块还是不熟悉&#xff0c;因为没有通过确定有效的途径知道当前工作正常的内核中到底使用了什么驱动模块来控制硬件&#xff0c;最近看到一本书《Linux kernel in a netshell》&#xff0c;感觉讲的还…