mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
数据库和缓存读写计数调整 增加页面Trace日志驱动(需要设置'response_exit'=>false) Log::record方法支持字符串之外的变量输出
This commit is contained in:
2
library/think/cache/driver/apc.php
vendored
2
library/think/cache/driver/apc.php
vendored
@@ -52,6 +52,7 @@ class Apc
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
\think\Cache::$readTimes++;
|
||||
return apc_fetch($this->options['prefix'] . $name);
|
||||
}
|
||||
|
||||
@@ -65,6 +66,7 @@ class Apc
|
||||
*/
|
||||
public function set($name, $value, $expire = null)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
if (is_null($expire)) {
|
||||
$expire = $this->options['expire'];
|
||||
}
|
||||
|
||||
2
library/think/cache/driver/db.php
vendored
2
library/think/cache/driver/db.php
vendored
@@ -55,6 +55,7 @@ class Db
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
\think\Cache::$readTimes++;
|
||||
$name = $this->options['prefix'] . addslashes($name);
|
||||
$result = $this->handler->query('SELECT `data`,`datacrc` FROM `' . $this->options['table'] . '` WHERE `cachekey`=\'' . $name . '\' AND (`expire` =0 OR `expire`>' . time() . ') LIMIT 0,1');
|
||||
if (false !== $result) {
|
||||
@@ -81,6 +82,7 @@ class Db
|
||||
*/
|
||||
public function set($name, $value, $expire = null)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
$data = serialize($value);
|
||||
$name = $this->options['prefix'] . addslashes($name);
|
||||
if (function_exists('gzcompress')) {
|
||||
|
||||
2
library/think/cache/driver/eaccelerator.php
vendored
2
library/think/cache/driver/eaccelerator.php
vendored
@@ -44,6 +44,7 @@ class Eaccelerator
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
\think\Cache::$readTimes++;
|
||||
return eaccelerator_get($this->options['prefix'] . $name);
|
||||
}
|
||||
|
||||
@@ -57,6 +58,7 @@ class Eaccelerator
|
||||
*/
|
||||
public function set($name, $value, $expire = null)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
if (is_null($expire)) {
|
||||
$expire = $this->options['expire'];
|
||||
}
|
||||
|
||||
2
library/think/cache/driver/file.php
vendored
2
library/think/cache/driver/file.php
vendored
@@ -98,6 +98,7 @@ class File
|
||||
if (!is_file($filename)) {
|
||||
return false;
|
||||
}
|
||||
\think\Cache::$readTimes++;
|
||||
$content = file_get_contents($filename);
|
||||
if (false !== $content) {
|
||||
$expire = (int) substr($content, 8, 12);
|
||||
@@ -128,6 +129,7 @@ class File
|
||||
*/
|
||||
public function set($name, $value, $expire = null)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
if (is_null($expire)) {
|
||||
$expire = $this->options['expire'];
|
||||
}
|
||||
|
||||
2
library/think/cache/driver/memcache.php
vendored
2
library/think/cache/driver/memcache.php
vendored
@@ -63,6 +63,7 @@ class Memcache
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
\think\Cache::$readTimes++;
|
||||
return $this->handler->get($this->options['prefix'] . $name);
|
||||
}
|
||||
|
||||
@@ -76,6 +77,7 @@ class Memcache
|
||||
*/
|
||||
public function set($name, $value, $expire = null)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
if (is_null($expire)) {
|
||||
$expire = $this->options['expire'];
|
||||
}
|
||||
|
||||
2
library/think/cache/driver/redis.php
vendored
2
library/think/cache/driver/redis.php
vendored
@@ -58,6 +58,7 @@ class Redis
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
\think\Cache::$readTimes++;
|
||||
return $this->handler->get($this->options['prefix'] . $name);
|
||||
}
|
||||
|
||||
@@ -71,6 +72,7 @@ class Redis
|
||||
*/
|
||||
public function set($name, $value, $expire = null)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
if (is_null($expire)) {
|
||||
$expire = $this->options['expire'];
|
||||
}
|
||||
|
||||
2
library/think/cache/driver/sae.php
vendored
2
library/think/cache/driver/sae.php
vendored
@@ -56,6 +56,7 @@ class Sae
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
\think\Cache::$readTimes++;
|
||||
return $this->handler->get($_SERVER['HTTP_APPVERSION'] . '/' . $this->options['prefix'] . $name);
|
||||
}
|
||||
|
||||
@@ -69,6 +70,7 @@ class Sae
|
||||
*/
|
||||
public function set($name, $value, $expire = null)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
if (is_null($expire)) {
|
||||
$expire = $this->options['expire'];
|
||||
}
|
||||
|
||||
2
library/think/cache/driver/secache.php
vendored
2
library/think/cache/driver/secache.php
vendored
@@ -53,6 +53,7 @@ class Secache
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
\think\Cache::$readTimes++;
|
||||
$name = $this->options['prefix'] . $name;
|
||||
$key = md5($name);
|
||||
$this->handler->fetch($key, $return);
|
||||
@@ -69,6 +70,7 @@ class Secache
|
||||
*/
|
||||
public function set($name, $value)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
$name = $this->options['prefix'] . $name;
|
||||
$key = md5($name);
|
||||
if ($result = $this->handler->store($key, $value)) {
|
||||
|
||||
2
library/think/cache/driver/simple.php
vendored
2
library/think/cache/driver/simple.php
vendored
@@ -59,6 +59,7 @@ class Simple
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
\think\Cache::$readTimes++;
|
||||
$filename = $this->filename($name);
|
||||
if (is_file($filename)) {
|
||||
return include $filename;
|
||||
@@ -79,6 +80,7 @@ class Simple
|
||||
*/
|
||||
public function set($name, $value)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
$filename = $this->filename($name);
|
||||
// 缓存数据
|
||||
$dir = dirname($filename);
|
||||
|
||||
2
library/think/cache/driver/sqlite.php
vendored
2
library/think/cache/driver/sqlite.php
vendored
@@ -57,6 +57,7 @@ class Sqlite
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
\think\Cache::$readTimes++;
|
||||
$name = $this->options['prefix'] . sqlite_escape_string($name);
|
||||
$sql = 'SELECT value FROM ' . $this->options['table'] . ' WHERE var=\'' . $name . '\' AND (expire=0 OR expire >' . time() . ') LIMIT 1';
|
||||
$result = sqlite_query($this->handler, $sql);
|
||||
@@ -81,6 +82,7 @@ class Sqlite
|
||||
*/
|
||||
public function set($name, $value, $expire = null)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
$name = $this->options['prefix'] . sqlite_escape_string($name);
|
||||
$value = sqlite_escape_string(serialize($value));
|
||||
if (is_null($expire)) {
|
||||
|
||||
2
library/think/cache/driver/wincache.php
vendored
2
library/think/cache/driver/wincache.php
vendored
@@ -52,6 +52,7 @@ class Wincache
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
\think\Cache::$readTimes++;
|
||||
$name = $this->options['prefix'] . $name;
|
||||
return wincache_ucache_exists($name) ? wincache_ucache_get($name) : false;
|
||||
}
|
||||
@@ -66,6 +67,7 @@ class Wincache
|
||||
*/
|
||||
public function set($name, $value, $expire = null)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
if (is_null($expire)) {
|
||||
$expire = $this->options['expire'];
|
||||
}
|
||||
|
||||
2
library/think/cache/driver/xcache.php
vendored
2
library/think/cache/driver/xcache.php
vendored
@@ -49,6 +49,7 @@ class Xcache
|
||||
*/
|
||||
public function get($name)
|
||||
{
|
||||
\think\Cache::$readTimes++;
|
||||
$name = $this->options['prefix'] . $name;
|
||||
if (xcache_isset($name)) {
|
||||
return xcache_get($name);
|
||||
@@ -66,6 +67,7 @@ class Xcache
|
||||
*/
|
||||
public function set($name, $value, $expire = null)
|
||||
{
|
||||
\think\Cache::$writeTimes++;
|
||||
if (is_null($expire)) {
|
||||
$expire = $this->options['expire'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user