Cache library |
[eluser]Sbioko[/eluser]
Hi all! Today, I want to represent you my new library! This will be a part of my CMS. But I want to share it with everyone! Supports Memcached, XCache, eAccelerator, APC and Native implementation of caching. Installation: Unpack Cache.zip. Move Cache.php to your application/libraries folder. Then move cache_config.php to your application/config folder AND rename it to cache.php. That's it! How to use it: Syntax is very easy, but if you need more samples, feel free to say! Code: $this->load->library('cache'); Also, I've implemented such methods as: Code: $this->cache->increment('test_key'); Warning: I didn't test it with Memcached, eAccelerator. Please, if you can do it, pm me about your results.
[eluser]Phil Sturgeon[/eluser]
Good stuff. I never quite got around to adding Memcache to my Cache library. One of those "I'll do it next week" jobs I never bothered with. I'm not sure I like your suggestion that people put this library in the system/libraries folder, and its a bit strange that you called your library CI_Class as it is not. Third-party libraries should be kept in application/libraries so system can be blammed at any point for a new version.
[eluser]Sbioko[/eluser]
I think, if you don't like that I named it with CI_ prefix, you can easily change it to yours. This is not a big problem.
[eluser]Phil Sturgeon[/eluser]
Just call it class Cache, it's not a core library. It's not a complaint just take the feedback.
[eluser]Sbioko[/eluser]
Ok, I will do it in the next version. Thank you for discussion!
[eluser]dungdn[/eluser]
I have an error when use this library with memcache: Fatal error: Call to a member function set() on a non-object in E:\UniServer50\www\ione\includes\system\libraries\Cache.php on line 125 Can anyone show me the reason why..???
[eluser]echoDreamz[/eluser]
Sweet, could you look into adding Wincache? http://php.net/manual/en/book.wincache.php Its a new opcode caching mechanism developed by Microsoft specifically designed for IIS and Windows.
[eluser]InsiteFX[/eluser]
As Phil pointed out to you above, if you read the CodeIgniter Users Guide you would have read this! Please note that all native CodeIgniter libraries are prefixed with CI_ so DO NOT use that as your prefix. InsiteFX
[eluser]RaZoR LeGaCy[/eluser]
I am awaiting the next version with the proper class names and waiting to see if I can replace a current memcache version using zend framework.
[eluser]Sbioko[/eluser]
Bang bang! Update! -Fixed memcache error. -Code is more beautiful now -Added simple validations -PHP5 only -Changed class name Tell me, if something wrong. :-) |
Welcome Guest, Not a member yet? Register Sign In |