Welcome Guest, Not a member yet? Register   Sign In
CachedObjects v1.2 - cache granularity as you want
#1

[eluser]sdbruder[/eluser]
CachedObjects v1.2
cache granularity as you want

CachedObjects is a core extension (MY_Controller and MY_Model extensions) that implements caching at method level at call time.

Apart from extending the MY_ versions, all that you need to do is:
* Declare the time to cache calling methodcache(time_in_minutes);
* call ->mymethodCached(parameters) to cache ->mymethod(parameters);
* WARNING: CachedObjects will use object name, method name and parameter values to hash the cache name. If your method can accept a multitude of diferent values as parameters, you will get a multitude of cache entries. USE IT WISELY!

TODO
* The cache code is replicated in MY_Controller and MY_Model extensions, the bulk of it can be
extracted to a single place to avoid code replication.

In the package, there is a model / view / controller as an example, Open it in your applicaction directory and call http://yourserver/index.php/examplepage/. If you use it in your project, please send an email.

Download: http://sergio.bruder.com.br/cachedobjects/
#2

[eluser]Maxximus[/eluser]
Hi, sounds interesting! I downloaded it, but wasn't able to open the archive (tried it as well as bz2, even as a zip). Could you have a look?
#3

[eluser]sdbruder[/eluser]
In any *nix or mac os you can open it with tar -xvzf cachedobjects-1.2.tar.gz, Ive just verified it. In Windows you can use 7zip, freeware, opens it.
I'll submit a zip later.
#4

[eluser]Maxximus[/eluser]
hmm well:
Code:
tar -xvzf cachedobjects-1.2.tar.gz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors
Running Ubuntu Hardy. Will wait for your zip.
#5

[eluser]sdbruder[/eluser]
Ive just downloaded it:

Code:
stratus:Downloads sergio$ file cachedobjects-1.2.tar
cachedobjects-1.2.tar: gzip compressed data, from Unix, last modified: Mon Jun  2 23:03:50 2008
stratus:Downloads sergio$ mv cachedobjects-1.2.tar  cachedobjects-1.2.tar.gz
stratus:Downloads sergio$ cd ~/temp
stratus:temp sergio$ tar -xvzf ~/Downloads/cachedobjects-1.2.tar.gz
libraries/MY_Controller.php
libraries/MY_Model.php
controllers/._examplepage.php
controllers/examplepage.php
models/examplemodel.php
views/._exampleview.php
views/exampleview.php
stratus:temp sergio$

Ive just uploaded a .ZIP version of it: http://sergio.bruder.com.br/cachedobject...ts-1.2.zip
#6

[eluser]Maxximus[/eluser]
Ok, ZIP works just fine. Looks nice! Will explore it further.
#7

[eluser]jstrebel[/eluser]
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of [runtime function name](). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /site/application/libraries/MY_Model.php on line 110

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of call_user_method_array(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /site/application/libraries/MY_Model.php on line 111

Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of call_user_method_array(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /site/application/libraries/MY_Model.php on line 115

Parse error: syntax error, unexpected T_NEW in /site/application/libraries/MY_Model.php on line 119
#8

[eluser]sdbruder[/eluser]
what version of PHP? php 5.2.5 here.
#9

[eluser]mglinski[/eluser]
Feature request that will make this very popular with big projects, implement MemCached as a cache storage object. If you want help with this let me know, as I am working on it now. Big Grin
-Matt
#10

[eluser]sdbruder[/eluser]
Ive just included configurable backends for CachedObjects, implemented the original CodeIgniter system cache FS-based and a memcache backend.

Already tested the 2 backends, I only need to finish the documentation and get some sleep, I'll upload version 1.3 with ci-fs and memcache backends.




Theme © iAndrew 2016 - Forum software by © MyBB