狠狠撸
Search
Submit Search
CI2.x 加入連線 redis 的功能
?
0 likes
?
662 views
Onnie Fong
Codeigniter 2.x 加入連線 Redis 的功能
Read less
Read more
1 of 8
Download now
Download to read offline
More Related Content
CI2.x 加入連線 redis 的功能
1.
codeigniter cache driver
: redis CI 2.x + Redis codeigniter 整合 redis 的暫存功能
2.
– wiki 「Redis是?一個開源、??支援網路、?基於記憶體、?鍵值 對儲存資料庫,使?用ANSI C編寫。?」
3.
Ubuntu + Nginx
+ Redis libs ? 要先讓web server?支援redis,執?行底下的指令 $ apt-get install php5-redis $ service php5-fpm restart $ service nginx restart
4.
Codeigniter vs Redis ?
CI 2.x 沒有 Redis 的 Driver ? CI 3.x 有 Redis 的 Driver
5.
整合?方式 ?避免更新System時,把redis driver移除,所以建議放到 application下。? 1.將systemlibrariesCacheCache.php copy到 applicationlibrariesCacheCache.php 2.在
applicationcon?g中,建?立 redis.php的con?g檔 案 3.下載CI3.x 的 Cache_redis.php 存入 application librariesCachedrivers
6.
整合图?示
7.
使?用?方式 $this->load->driver('cache'); if ($this->cache->is_supported('redis'))? { $this->cache->redis->save('cache_key', 'cache_value',
300); echo $this->cache->redis->get('cache_key'); }
8.
參考資料 ? Wiki- Redis? http://zh.wikipedia.org/wiki/Redis ?
CI 2.x + Redis? http://codeigniter.org.cn/forums/thread-17108-1-1.html ? CI 3.x 的 Cache_Redis.php? https://github.com/bcit-ci/CodeIgniter/blob/develop/ system/libraries/Cache/drivers/Cache_redis.php?
Download