<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] * * * * * ## 1 文件 tp5的緩存驅動目錄thinkphp\library\think\cache\driver\ 通過各種緩存機制實現**鍵值對數據**的緩存 包含以下**12種** * * * * * 1 Apc.php Apc緩存 2 Db.php 數據庫表緩存 3 File.php 帶隊列文件緩存 4 Lite.php 簡單文件緩存 5 Memcache.php Memcache緩存 6 Memcached.php Memecached緩存 7 Redis.php Redis.php緩存 8 Sae.php Sae平臺緩存 9 Secache.php Secache緩存 10 Sqlite.php Sqlite緩存 11 Wincache.php Wincache緩存 12 Xcache Xcache緩存 * * * * * 數據庫類型 > Db [Redis](http://www.redis.cn/) [Sqlite](http://sqlite.in/) 進程類型 > [Memcache](http://php.net/manual/zh/book.memcache.php) [Memcached](http://php.net/manual/zh/book.memcached.php) 文件類型 > File Lite php實現 > [Secache](https://github.com/shopex/secache) 擴展實現 > [Apc](http://php.net/apc) [Xcache](http://xcache.lighttpd.net/wiki/XcacheApi) 平臺實現 > [Sae](http://www.sinacloud.com/doc/sae/php/memcache.html) [Wincache](http://php.net/manual/en/book.wincache.php) ## 2 緩存驅動 > 1 緩存配置 全局配置文件convention.php ~~~ 'cache' => [ 'type' => 'File', 'path' => CACHE_PATH, 'prefix' => '', 'expire' => 0, ], ~~~ > 2 緩存初始化 thinkphp\library\think\Cache.php的connect() ~~~ if (!isset(self::$instance[$md5])) { $type = !empty($options['type']) ? $options['type'] : 'File'; $class = (!empty($options['namespace']) ? $options['namespace'] : '\\think\\cache\\driver\\') . ucwords($type); unset($options['type']); self::$instance[$md5] = new $class($options); APP_DEBUG && Log::record('[ CACHE ] INIT ' . $type . ':' . var_export($options, true), 'info'); } ~~~ 分析可知根據緩存配置的type值,選擇對應的緩存驅動進行初始 ## 3 緩存驅動接口 1 `public function __construct($options = []){}` 緩存初始化接口。 > $options:緩存配置參數 2 `public function get($name){}` 讀取緩存接口 > $name:緩存鍵名 3 `public function set($name, $value, $expire = null){}` 寫入緩存接口 > $name:緩存鍵名 > $value:緩存鍵值 > $expire:緩存鍵名前綴 4 `public function rm($name){}` 刪除緩存接口 > $name:緩存鍵名 5 `public function clear(){}` 清空緩存接口 ## 4 總結 1 緩存配置 > convention.php 2 緩存初始化 > Cache::connect($options) 3 緩存接口 > 5個public方法 > __construct() get() set() rm() clear()
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看