cvs: peardoc /en/package/caching cache-lite.xml /en/package/caching/cache-lite intro.xml /en/package/caching/cache-lite/cache-lite cache_lite.xml
extendlife.xml /en/package/caching/cache-lite/cache-lite-file cache_lite_file.xml /en/package/caching/cache-lite/cache-lite-function
cache_lite_function.xml call.xml /en/package/caching/cache-lite/cache-lite-output cache_lite_output.xml
| From: | Fabien MARTY | Date: | Tue, 07 Feb 2006 23:18:00 +0000 |
| Subject: | cvs: peardoc /en/package/caching cache-lite.xml /en/package/caching/cache-lite intro.xml /en/package/caching/cache-lite/cache-lite cache_lite.xml extendlife.xml /en/package/caching/cache-lite/cache-lite-file cache_lite_file.xml /en/package/caching/cache-lite/cache-lite-function cache_lite_function.xml call.xml /en/package/caching/cache-lite/cache-lite-output cache_lite_output.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-7494@lists.php.net to get a copy of this message | ||
fab Tue Feb 7 23:18:00 2006 UTC
Added files:
/peardoc/en/package/caching/cache-lite/cache-lite extendlife.xml
Modified files:
/peardoc/en/package/caching cache-lite.xml
/peardoc/en/package/caching/cache-lite intro.xml
/peardoc/en/package/caching/cache-lite/cache-lite cache_lite.xml
/peardoc/en/package/caching/cache-lite/cache-lite-file
cache_lite_file.xml
/peardoc/en/package/caching/cache-lite/cache-lite-function
cache_lite_function.xml
call.xml
/peardoc/en/package/caching/cache-lite/cache-lite-output
cache_lite_output.xml
Log:
sync to Cache_Lite-1.7.0beta2
http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite.xml?r1=1.5&r2=1.6&diff_format=u Index: peardoc/en/package/caching/cache-lite.xml diff -u peardoc/en/package/caching/cache-lite.xml:1.5 peardoc/en/package/caching/cache-lite.xml:1.6 --- peardoc/en/package/caching/cache-lite.xml:1.5 Thu Nov 24 20:43:23 2005 +++ peardoc/en/package/caching/cache-lite.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="package.caching.cache-lite"> <title>Cache_Lite</title> @@ -21,6 +21,7 @@ &package.caching.cache-lite.cache-lite.getmemorycachingstate; &package.caching.cache-lite.cache-lite.lastmodified; &package.caching.cache-lite.cache-lite.raiseerror; + &package.caching.cache-lite.cache-lite.extendlife; &package.caching.cache-lite.cache-lite-output.cache-lite-output; &package.caching.cache-lite.cache-lite-output.start; http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/intro.xml?r1=1.5&r2=1.6&diff_format=u Index: peardoc/en/package/caching/cache-lite/intro.xml diff -u peardoc/en/package/caching/cache-lite/intro.xml:1.5 peardoc/en/package/caching/cache-lite/intro.xml:1.6 --- peardoc/en/package/caching/cache-lite/intro.xml:1.5 Sat Aug 13 16:46:50 2005 +++ peardoc/en/package/caching/cache-lite/intro.xml Tue Feb 7 23:17:59 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="package.caching.cache-lite.intro"> <refnamediv> @@ -78,6 +78,10 @@ For obvious flexibility reasons, the logic of IDs choice is left to the developer. </para> + <para> + In the following, we will use the term "group" as a pool of cache files and + the term "block" as a piece of an HTML page. + </para> </refsect2> <refsect2 id="package.caching.cache-lite.intro.usage.core"> <title>core</title> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml?r1=1.7&r2=1.8&diff_format=u Index: peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml diff -u peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml:1.7 peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml:1.8 --- peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml:1.7 Thu Nov 24 19:57:45 2005 +++ peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry id="package.caching.cache-lite.cache-lite.cache-lite"> <refnamediv> <refname>constructor <function>Cache_Lite::Cache_Lite</function></refname> @@ -317,6 +317,22 @@ Maybe, 1 or 2 is a good start. </entry> </row> + <row> + <entry> + errorHandlingAPIBreak + </entry> + <entry> + &type.bool; + </entry> + <entry> + &false; + </entry> + <entry> + If set to true, it introduces a little API break but the error handling + is better in CACHE_LITE_ERROR_RETURN mode (specially with the save() + method which can return a PEAR_Error object). + </entry> + </row> </tbody> </tgroup> </table> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml diff -u peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml:1.1 peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml:1.2 --- peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml:1.1 Fri Jun 24 17:23:41 2005 +++ peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.default.cache-lite.cache-lite-file.cache-lite-file"> <refnamediv> <refname>constructor <function>Cache_Lite_File::Cache_Lite_File</function></refname> @@ -18,7 +18,7 @@ <refsect1 id="package.default.cache-lite.cache-lite-file.cache-lite-file.desc"> &title.desc; - <para>[since 1.5.0 beta] The constructor of the Cache_Lite_File class. You can give an associative array + <para>The constructor of the Cache_Lite_File class. You can give an associative array as an argument to set a lot of options.</para> </refsect1> <refsect1 id="package.default.cache-lite.cache-lite-file.cache-lite-file.param"> @@ -34,7 +34,8 @@ </term> <listitem> <para> - associative array to set a lot of options + associative array to set a lot of options (see Cache_Lite constructor for details). Be carefull, + with Cache_Lite_File, there is an additional "mandatory option" described on the following table. </para> </listitem> </varlistentry> @@ -67,227 +68,6 @@ complete path of the file used for controlling the cache lifetime </entry> </row> - <row> - <entry> - cacheDir - </entry> - <entry> - &type.string; - </entry> - <entry> - /tmp/ - </entry> - <entry> - directory where to put the cache file (with a trailing slash at the end) - </entry> - </row> - <row> - <entry> - caching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable caching - </entry> - </row> - <row> - <entry> - fileLocking - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable fileLocking (can avoid cache corruption under bad - circumstances) - </entry> - </row> - <row> - <entry> - writeControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable write control (enable write control will lightly slow - the cache writing but not the cache reading, write control can detect - some corrupt cache files but maybe it's not a perfect control) - </entry> - </row> - <row> - <entry> - readControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable read control (if enabled, a control key is embeded - in cache file and this key is compared with the one calculated after - the reading) - </entry> - </row> - <row> - <entry> - readControlType - </entry> - <entry> - &type.string; - </entry> - <entry> - crc32 - </entry> - <entry> - Type of read control (only if read control is enabled). Must be 'md5' - (for a md5 hash control (best but slowest)), 'crc32' (for a crc32 hash - control (lightly less safe but faster)) or 'strlen' (for a length only - test (fastest)) - </entry> - </row> - <row> - <entry> - pearErrorMode - </entry> - <entry> - &type.int; - </entry> - <entry> - CACHE_LITE_ERROR_RETURN - </entry> - <entry> - pear error mode (when raiseError is called) (CACHE_LITE_ERROR_RETURN - for just returning a PEAR_Error object or CACHE_LITE_ERROR_DIE for - immediate stop of the script (good for debug)) - </entry> - </row> - <row> - <entry> - fileNameProtection - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - file Name protection (if set to true, you can use any cache id or - group name, if set to false, it can be faster but cache ids and group - names will be used directly in cache file names so be carefull with - special characters...) - </entry> - </row> - <row> - <entry> - automaticSerialization - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable automatic serialization (it can be used to save - directly datas which aren't strings but it's slower) - </entry> - </row> - <row> - <entry> - memoryCaching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable "Memory Caching" (NB : there is - no lifetime for memory caching, only the end of the script) - </entry> - </row> - <row> - <entry> - onlyMemoryCaching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable "Only Memory Caching" (if enabled, - files are not used anymore) - </entry> - </row> - <row> - <entry> - memoryCachingLimit - </entry> - <entry> - &type.int; - </entry> - <entry> - 1000 - </entry> - <entry> - max number of records to store into memory caching - </entry> - </row> - <row> - <entry> - automaticCleaningFactor - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Disable / Tune the automatic cleaning process. The - automatic cleaning process destroy too old (for the given life time) - cache files when a new cache file is written. 0 means "no automatic - cache cleaning", 1 means "systematic cache cleaning" (slow), x>1 means - "automatic cleaning randomly 1 times on x cache writes". A value - between 20 and 200 is maybe a good start. - </entry> - </row> - <row> - <entry> - hashedDirectoryLevel - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Set the hashed directory structure level. 0 means - "no hashed directory structure", 1 means "one level of directory", 2 - means "two levels"... This option can speed up Cache_Lite only when you - have many thousands of cache file. Only specific benchs can help - you to choose the perfect value for you. Maybe, 1 or 2 is a good start. - </entry> - </row> </tbody> </tgroup> </table> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml diff -u peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml:1.3 peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml:1.4 --- peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml:1.3 Thu Nov 24 18:55:10 2005 +++ peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="package.default.cache-lite.cache-lite-function.cache-lite-function"> <refnamediv> <refname>constructor <function>Cache_Lite_Function::Cache_Lite_Function</function></refname> @@ -34,7 +34,9 @@ </term> <listitem> <para> - options + associative array to set a lot of options (see Cache_Lite constructor for details). Be carefull, + with Cache_Lite_Function, additional options are available (comparatively to Cache_Lite). There are + described on the following table. </para> </listitem> </varlistentry> @@ -64,151 +66,26 @@ Cache_Lite_Function </entry> <entry> - [Cache/Lite/Function specific] default cache group for function caching + default cache group for function caching </entry> </row> <row> <entry> - cacheDir - </entry> - <entry> - &type.string; - </entry> - <entry> - /tmp/ - </entry> - <entry> - directory where to put the cache file (with a trailing slash at the end) - </entry> - </row> - <row> - <entry> - caching + debugCacheLiteFunction </entry> <entry> &type.bool; </entry> <entry> - &true; - </entry> - <entry> - enable / disable caching - </entry> - </row> - <row> - <entry> - lifeTime - </entry> - <entry> - &type.int; - </entry> - <entry> - 3600 - </entry> - <entry> - cache lifetime in seconds (since 1.6.0beta 1, you can use a null value for an eternal cache lifetime) - </entry> - </row> - <row> - <entry> - fileLocking - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable fileLocking (can avoid cache corruption under bad - circumstances) - </entry> - </row> - <row> - <entry> - writeControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable write control (enable write control will lightly slow - the cache writing but not the cache reading, write control can detect - some corrupt cache files but maybe it's not a perfect control) - </entry> - </row> - <row> - <entry> - readControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable read control (if enabled, a control key is embeded - in cache file and this key is compared with the one calculated after - the reading) - </entry> - </row> - <row> - <entry> - readControlType - </entry> - <entry> - &type.string; - </entry> - <entry> - crc32 - </entry> - <entry> - Type of read control (only if read control is enabled). Must be 'md5' - (for a md5 hash control (best but slowest)), 'crc32' (for a crc32 hash - control (lightly less safe but faster)) or 'strlen' (for a length only - test (fastest)) - </entry> - </row> - <row> - <entry> - pearErrorMode - </entry> - <entry> - &type.int; - </entry> - <entry> - CACHE_LITE_ERROR_RETURN - </entry> - <entry> - pear error mode (when raiseError is called) (CACHE_LITE_ERROR_RETURN - for just returning a PEAR_Error object or CACHE_LITE_ERROR_DIE for - immediate stop of the script (good for debug)) - </entry> - </row> - <row> - <entry> - fileNameProtection - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; + &false; </entry> <entry> - file Name protection (if set to true, you can use any cache id or - group name, if set to false, it can be faster but cache ids and group - names will be used directly in cache file names so be carefull with - special characters...) + debug the caching process </entry> </row> <row> <entry> - automaticSerialization + dontCacheWhenTheOutputContainsNOCACHE </entry> <entry> &type.bool; @@ -217,13 +94,13 @@ &false; </entry> <entry> - enable / disable automatic serialization (it can be used to save - directly datas which aren't strings but it's slower) + Don't cache the method call when its output contains the string "NOCACHE". If set to true, + the output of the method will never be displayed (because the output is used to control the cache) </entry> </row> <row> <entry> - memoryCaching + dontCacheWhenTheResultIsFalse </entry> <entry> &type.bool; @@ -232,13 +109,12 @@ &false; </entry> <entry> - enable / disable "Memory Caching" (NB : there is - no lifetime for memory caching, only the end of the script) + Don't cache the method call when its result is false </entry> </row> <row> <entry> - onlyMemoryCaching + dontCacheWhenTheResultIsNull </entry> <entry> &type.bool; @@ -247,59 +123,7 @@ &false; </entry> <entry> - enable / disable "Only Memory Caching" (if enabled, - files are not used anymore) - </entry> - </row> - <row> - <entry> - memoryCachingLimit - </entry> - <entry> - &type.int; - </entry> - <entry> - 1000 - </entry> - <entry> - max number of records to store into memory caching - </entry> - </row> - <row> - <entry> - automaticCleaningFactor - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Disable / Tune the automatic cleaning process. The - automatic cleaning process destroy too old (for the given life time) - cache files when a new cache file is written. 0 means "no automatic - cache cleaning", 1 means "systematic cache cleaning" (slow), x>1 means - "automatic cleaning randomly 1 times on x cache writes". A value - between 20 and 200 is maybe a good start. - </entry> - </row> - <row> - <entry> - hashedDirectoryLevel - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Set the hashed directory structure level. 0 means - "no hashed directory structure", 1 means "one level of directory", 2 - means "two levels"... This option can speed up Cache_Lite only when you - have many thousands of cache file. Only specific benchs can help - you to choose the perfect value for you. Maybe, 1 or 2 is a good start. + Don't cache the method call when its result is null </entry> </row> </tbody> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml diff -u peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml:1.3 peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml:1.4 --- peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml:1.3 Fri Jun 24 17:24:10 2005 +++ peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="package.default.cache-lite.cache-lite-function.call"> <refnamediv> <refname><function>Cache_Lite_Function::call</function></refname> @@ -112,8 +112,7 @@ </example> <para> If you try to use Cache_Lite_Function with $this object ($cache->call('this->method',...) - for example), have a look first at : - <ulink url="http://pear.php.net/bugs/bug.php?id=660">this bug</ulink> + for example), have a look first at the last example of this page. </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite-function.call.example3"> @@ -150,6 +149,54 @@ </programlisting> </example> </refsect1> + <refsect1 id="package.caching.cache-lite.cache-lite-function.call.example4"> + &title.example; + <example> + <title>another using with a method (how to use cache $this->method() calls)</title> + <programlisting role="php"> + <![CDATA[ +<?php + +// Since Cache_Lite-1.7.0beta2 + +require_once('Cache/Lite/Function.php'); + +$options = array( + 'cacheDir' => '/tmp/', + 'lifeTime' => 3600 +); + +$obj = new foo($options); + +class foo +{ + + var $test; + + function foo($options) + { + $cache = new Cache_Lite_Function($options); + $this->test = 'foobar'; + $cache->call(array(&$this, 'method_bar'), 12, 45); + } + + function method_bar($arg1, $arg2) + { + echo "\$this->test = $this->test and this is the output of the method \$this->method_bar($arg1, $arg2) !<br>"; + return "\$this->test = $this->test and this is the result of the method \$this->method_bar($arg1, $arg2) !<br>"; + } + +} + +?> + ]]> + </programlisting> + </example> + <para> + So, for method calls, the best way is to use array(&$object, 'nameOfTheMethod') as first argument instead + of '$object->nameOfTheMethod' which doesn't work with "$this" for example. + </para> + </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml diff -u peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml:1.3 peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml:1.4 --- peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml:1.3 Thu Nov 24 18:19:59 2005 +++ peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="package.default.cache-lite.cache-lite-output.cache-lite-output"> <refnamediv> <refname>constructor <function>Cache_Lite_Output::Cache_Lite_Output</function></refname> @@ -34,264 +34,12 @@ </term> <listitem> <para> - associative array to set a lot of options + associative array to set a lot of options (see Cache_Lite constructor for details) </para> </listitem> </varlistentry> </variablelist> </para> - <para> - <table> - <title></title> - <tgroup cols="4"> - <thead> - <row> - <entry>Option</entry> - <entry>Data Type</entry> - <entry>Default Value</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry> - cacheDir - </entry> - <entry> - &type.string; - </entry> - <entry> - /tmp/ - </entry> - <entry> - directory where to put the cache file (with a trailing slash at the end) - </entry> - </row> - <row> - <entry> - caching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable caching - </entry> - </row> - <row> - <entry> - lifeTime - </entry> - <entry> - &type.int; - </entry> - <entry> - 3600 - </entry> - <entry> - cache lifetime in seconds (since 1.6.0beta 1, you can use a null value for an eternal cache lifetime) - </entry> - </row> - <row> - <entry> - fileLocking - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable fileLocking (can avoid cache corruption under bad - circumstances) - </entry> - </row> - <row> - <entry> - writeControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable write control (enable write control will lightly slow - the cache writing but not the cache reading, write control can detect - some corrupt cache files but maybe it's not a perfect control) - </entry> - </row> - <row> - <entry> - readControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable read control (if enabled, a control key is embeded - in cache file and this key is compared with the one calculated after - the reading) - </entry> - </row> - <row> - <entry> - readControlType - </entry> - <entry> - &type.string; - </entry> - <entry> - crc32 - </entry> - <entry> - Type of read control (only if read control is enabled). Must be 'md5' - (for a md5 hash control (best but slowest)), 'crc32' (for a crc32 hash - control (lightly less safe but faster)) or 'strlen' (for a length only - test (fastest)) - </entry> - </row> - <row> - <entry> - pearErrorMode - </entry> - <entry> - &type.int; - </entry> - <entry> - CACHE_LITE_ERROR_RETURN - </entry> - <entry> - pear error mode (when raiseError is called) (CACHE_LITE_ERROR_RETURN - for just returning a PEAR_Error object or CACHE_LITE_ERROR_DIE for - immediate stop of the script (good for debug)) - </entry> - </row> - <row> - <entry> - fileNameProtection - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - file Name protection (if set to true, you can use any cache id or - group name, if set to false, it can be faster but cache ids and group - names will be used directly in cache file names so be carefull with - special characters...) - </entry> - </row> - <row> - <entry> - automaticSerialization - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable automatic serialization (it can be used to save - directly datas which aren't strings but it's slower) - </entry> - </row> - <row> - <entry> - memoryCaching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable "Memory Caching" (NB : there is - no lifetime for memory caching, only the end of the script) - </entry> - </row> - <row> - <entry> - onlyMemoryCaching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable "Only Memory Caching" (if enabled, - files are not used anymore) - </entry> - </row> - <row> - <entry> - memoryCachingLimit - </entry> - <entry> - &type.int; - </entry> - <entry> - 1000 - </entry> - <entry> - max number of records to store into memory caching - </entry> - </row> - <row> - <entry> - automaticCleaningFactor - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Disable / Tune the automatic cleaning process. The - automatic cleaning process destroy too old (for the given life time) - cache files when a new cache file is written. 0 means "no automatic - cache cleaning", 1 means "systematic cache cleaning" (slow), x>1 means - "automatic cleaning randomly 1 times on x cache writes". A value - between 20 and 200 is maybe a good start. - </entry> - </row> - <row> - <entry> - hashedDirectoryLevel - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Set the hashed directory structure level. 0 means - "no hashed directory structure", 1 means "one level of directory", 2 - means "two levels"... This option can speed up Cache_Lite only when you - have many thousands of cache file. Only specific benchs can help - you to choose the perfect value for you. Maybe, 1 or 2 is a good start. - </entry> - </row> - </tbody> - </tgroup> - </table> - </para> </refsect1> <refsect1 id="package.default.cache-lite.cache-lite-output.cache-lite-output.note"> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite/extendlife.xml?view=markup&rev=1.1 Index: peardoc/en/package/caching/cache-lite/cache-lite/extendlife.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/extendlife.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.extend-life"> <refnamediv> <refname><function>Cache_Lite::extendLife</function></refname> <refpurpose>Extend the life of a valid cache file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Cache/Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>Cache_Lite::extendLife</function></funcdef> <paramdef/> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.extend-life.desc"> &title.desc; <para> [since Cache_Lite-1.7.0beta2] Extend the life of an existent cache file. The cache file is "touched", so it starts a new lifetime period. See <ulink url="http://pear.php.net/bugs/bug.php?id=6681">this feature request</ulink> for more details. </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.extend-life.throws"> &title.throws; &noexceptions; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.extend-life.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.extend-life.example"> &title.example; <example> <title>Classical use</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array( 'cacheDir' => '/tmp/', 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE ); $cache = new Cache_Lite($options); $id = 'foo'; if (!($data = $cache->get($id))) { // the cache is not hit ! $data = '123456789'; $cache->save($data); } else { // the cache is hit ! if (isset($_GET['extend'])) { $cache->extendLife(); } } echo($data); ?> ]]> </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite.xml?r1=1.5&r2=1.6&diff_format=u Index: peardoc/en/package/caching/cache-lite.xml diff -u peardoc/en/package/caching/cache-lite.xml:1.5 peardoc/en/package/caching/cache-lite.xml:1.6 --- peardoc/en/package/caching/cache-lite.xml:1.5 Thu Nov 24 20:43:23 2005 +++ peardoc/en/package/caching/cache-lite.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="package.caching.cache-lite"> <title>Cache_Lite</title> @@ -21,6 +21,7 @@ &package.caching.cache-lite.cache-lite.getmemorycachingstate; &package.caching.cache-lite.cache-lite.lastmodified; &package.caching.cache-lite.cache-lite.raiseerror; + &package.caching.cache-lite.cache-lite.extendlife; &package.caching.cache-lite.cache-lite-output.cache-lite-output; &package.caching.cache-lite.cache-lite-output.start; http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/intro.xml?r1=1.5&r2=1.6&diff_format=u Index: peardoc/en/package/caching/cache-lite/intro.xml diff -u peardoc/en/package/caching/cache-lite/intro.xml:1.5 peardoc/en/package/caching/cache-lite/intro.xml:1.6 --- peardoc/en/package/caching/cache-lite/intro.xml:1.5 Sat Aug 13 16:46:50 2005 +++ peardoc/en/package/caching/cache-lite/intro.xml Tue Feb 7 23:17:59 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1" ?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <refentry id="package.caching.cache-lite.intro"> <refnamediv> @@ -78,6 +78,10 @@ For obvious flexibility reasons, the logic of IDs choice is left to the developer. </para> + <para> + In the following, we will use the term "group" as a pool of cache files and + the term "block" as a piece of an HTML page. + </para> </refsect2> <refsect2 id="package.caching.cache-lite.intro.usage.core"> <title>core</title> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml?r1=1.7&r2=1.8&diff_format=u Index: peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml diff -u peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml:1.7 peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml:1.8 --- peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml:1.7 Thu Nov 24 19:57:45 2005 +++ peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <refentry id="package.caching.cache-lite.cache-lite.cache-lite"> <refnamediv> <refname>constructor <function>Cache_Lite::Cache_Lite</function></refname> @@ -317,6 +317,22 @@ Maybe, 1 or 2 is a good start. </entry> </row> + <row> + <entry> + errorHandlingAPIBreak + </entry> + <entry> + &type.bool; + </entry> + <entry> + &false; + </entry> + <entry> + If set to true, it introduces a little API break but the error handling + is better in CACHE_LITE_ERROR_RETURN mode (specially with the save() + method which can return a PEAR_Error object). + </entry> + </row> </tbody> </tgroup> </table> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml diff -u peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml:1.1 peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml:1.2 --- peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml:1.1 Fri Jun 24 17:23:41 2005 +++ peardoc/en/package/caching/cache-lite/cache-lite-file/cache_lite_file.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.default.cache-lite.cache-lite-file.cache-lite-file"> <refnamediv> <refname>constructor <function>Cache_Lite_File::Cache_Lite_File</function></refname> @@ -18,7 +18,7 @@ <refsect1 id="package.default.cache-lite.cache-lite-file.cache-lite-file.desc"> &title.desc; - <para>[since 1.5.0 beta] The constructor of the Cache_Lite_File class. You can give an associative array + <para>The constructor of the Cache_Lite_File class. You can give an associative array as an argument to set a lot of options.</para> </refsect1> <refsect1 id="package.default.cache-lite.cache-lite-file.cache-lite-file.param"> @@ -34,7 +34,8 @@ </term> <listitem> <para> - associative array to set a lot of options + associative array to set a lot of options (see Cache_Lite constructor for details). Be carefull, + with Cache_Lite_File, there is an additional "mandatory option" described on the following table. </para> </listitem> </varlistentry> @@ -67,227 +68,6 @@ complete path of the file used for controlling the cache lifetime </entry> </row> - <row> - <entry> - cacheDir - </entry> - <entry> - &type.string; - </entry> - <entry> - /tmp/ - </entry> - <entry> - directory where to put the cache file (with a trailing slash at the end) - </entry> - </row> - <row> - <entry> - caching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable caching - </entry> - </row> - <row> - <entry> - fileLocking - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable fileLocking (can avoid cache corruption under bad - circumstances) - </entry> - </row> - <row> - <entry> - writeControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable write control (enable write control will lightly slow - the cache writing but not the cache reading, write control can detect - some corrupt cache files but maybe it's not a perfect control) - </entry> - </row> - <row> - <entry> - readControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable read control (if enabled, a control key is embeded - in cache file and this key is compared with the one calculated after - the reading) - </entry> - </row> - <row> - <entry> - readControlType - </entry> - <entry> - &type.string; - </entry> - <entry> - crc32 - </entry> - <entry> - Type of read control (only if read control is enabled). Must be 'md5' - (for a md5 hash control (best but slowest)), 'crc32' (for a crc32 hash - control (lightly less safe but faster)) or 'strlen' (for a length only - test (fastest)) - </entry> - </row> - <row> - <entry> - pearErrorMode - </entry> - <entry> - &type.int; - </entry> - <entry> - CACHE_LITE_ERROR_RETURN - </entry> - <entry> - pear error mode (when raiseError is called) (CACHE_LITE_ERROR_RETURN - for just returning a PEAR_Error object or CACHE_LITE_ERROR_DIE for - immediate stop of the script (good for debug)) - </entry> - </row> - <row> - <entry> - fileNameProtection - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - file Name protection (if set to true, you can use any cache id or - group name, if set to false, it can be faster but cache ids and group - names will be used directly in cache file names so be carefull with - special characters...) - </entry> - </row> - <row> - <entry> - automaticSerialization - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable automatic serialization (it can be used to save - directly datas which aren't strings but it's slower) - </entry> - </row> - <row> - <entry> - memoryCaching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable "Memory Caching" (NB : there is - no lifetime for memory caching, only the end of the script) - </entry> - </row> - <row> - <entry> - onlyMemoryCaching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable "Only Memory Caching" (if enabled, - files are not used anymore) - </entry> - </row> - <row> - <entry> - memoryCachingLimit - </entry> - <entry> - &type.int; - </entry> - <entry> - 1000 - </entry> - <entry> - max number of records to store into memory caching - </entry> - </row> - <row> - <entry> - automaticCleaningFactor - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Disable / Tune the automatic cleaning process. The - automatic cleaning process destroy too old (for the given life time) - cache files when a new cache file is written. 0 means "no automatic - cache cleaning", 1 means "systematic cache cleaning" (slow), x>1 means - "automatic cleaning randomly 1 times on x cache writes". A value - between 20 and 200 is maybe a good start. - </entry> - </row> - <row> - <entry> - hashedDirectoryLevel - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Set the hashed directory structure level. 0 means - "no hashed directory structure", 1 means "one level of directory", 2 - means "two levels"... This option can speed up Cache_Lite only when you - have many thousands of cache file. Only specific benchs can help - you to choose the perfect value for you. Maybe, 1 or 2 is a good start. - </entry> - </row> </tbody> </tgroup> </table> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml diff -u peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml:1.3 peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml:1.4 --- peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml:1.3 Thu Nov 24 18:55:10 2005 +++ peardoc/en/package/caching/cache-lite/cache-lite-function/cache_lite_function.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="package.default.cache-lite.cache-lite-function.cache-lite-function"> <refnamediv> <refname>constructor <function>Cache_Lite_Function::Cache_Lite_Function</function></refname> @@ -34,7 +34,9 @@ </term> <listitem> <para> - options + associative array to set a lot of options (see Cache_Lite constructor for details). Be carefull, + with Cache_Lite_Function, additional options are available (comparatively to Cache_Lite). There are + described on the following table. </para> </listitem> </varlistentry> @@ -64,151 +66,26 @@ Cache_Lite_Function </entry> <entry> - [Cache/Lite/Function specific] default cache group for function caching + default cache group for function caching </entry> </row> <row> <entry> - cacheDir - </entry> - <entry> - &type.string; - </entry> - <entry> - /tmp/ - </entry> - <entry> - directory where to put the cache file (with a trailing slash at the end) - </entry> - </row> - <row> - <entry> - caching + debugCacheLiteFunction </entry> <entry> &type.bool; </entry> <entry> - &true; - </entry> - <entry> - enable / disable caching - </entry> - </row> - <row> - <entry> - lifeTime - </entry> - <entry> - &type.int; - </entry> - <entry> - 3600 - </entry> - <entry> - cache lifetime in seconds (since 1.6.0beta 1, you can use a null value for an eternal cache lifetime) - </entry> - </row> - <row> - <entry> - fileLocking - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable fileLocking (can avoid cache corruption under bad - circumstances) - </entry> - </row> - <row> - <entry> - writeControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable write control (enable write control will lightly slow - the cache writing but not the cache reading, write control can detect - some corrupt cache files but maybe it's not a perfect control) - </entry> - </row> - <row> - <entry> - readControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable read control (if enabled, a control key is embeded - in cache file and this key is compared with the one calculated after - the reading) - </entry> - </row> - <row> - <entry> - readControlType - </entry> - <entry> - &type.string; - </entry> - <entry> - crc32 - </entry> - <entry> - Type of read control (only if read control is enabled). Must be 'md5' - (for a md5 hash control (best but slowest)), 'crc32' (for a crc32 hash - control (lightly less safe but faster)) or 'strlen' (for a length only - test (fastest)) - </entry> - </row> - <row> - <entry> - pearErrorMode - </entry> - <entry> - &type.int; - </entry> - <entry> - CACHE_LITE_ERROR_RETURN - </entry> - <entry> - pear error mode (when raiseError is called) (CACHE_LITE_ERROR_RETURN - for just returning a PEAR_Error object or CACHE_LITE_ERROR_DIE for - immediate stop of the script (good for debug)) - </entry> - </row> - <row> - <entry> - fileNameProtection - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; + &false; </entry> <entry> - file Name protection (if set to true, you can use any cache id or - group name, if set to false, it can be faster but cache ids and group - names will be used directly in cache file names so be carefull with - special characters...) + debug the caching process </entry> </row> <row> <entry> - automaticSerialization + dontCacheWhenTheOutputContainsNOCACHE </entry> <entry> &type.bool; @@ -217,13 +94,13 @@ &false; </entry> <entry> - enable / disable automatic serialization (it can be used to save - directly datas which aren't strings but it's slower) + Don't cache the method call when its output contains the string "NOCACHE". If set to true, + the output of the method will never be displayed (because the output is used to control the cache) </entry> </row> <row> <entry> - memoryCaching + dontCacheWhenTheResultIsFalse </entry> <entry> &type.bool; @@ -232,13 +109,12 @@ &false; </entry> <entry> - enable / disable "Memory Caching" (NB : there is - no lifetime for memory caching, only the end of the script) + Don't cache the method call when its result is false </entry> </row> <row> <entry> - onlyMemoryCaching + dontCacheWhenTheResultIsNull </entry> <entry> &type.bool; @@ -247,59 +123,7 @@ &false; </entry> <entry> - enable / disable "Only Memory Caching" (if enabled, - files are not used anymore) - </entry> - </row> - <row> - <entry> - memoryCachingLimit - </entry> - <entry> - &type.int; - </entry> - <entry> - 1000 - </entry> - <entry> - max number of records to store into memory caching - </entry> - </row> - <row> - <entry> - automaticCleaningFactor - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Disable / Tune the automatic cleaning process. The - automatic cleaning process destroy too old (for the given life time) - cache files when a new cache file is written. 0 means "no automatic - cache cleaning", 1 means "systematic cache cleaning" (slow), x>1 means - "automatic cleaning randomly 1 times on x cache writes". A value - between 20 and 200 is maybe a good start. - </entry> - </row> - <row> - <entry> - hashedDirectoryLevel - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Set the hashed directory structure level. 0 means - "no hashed directory structure", 1 means "one level of directory", 2 - means "two levels"... This option can speed up Cache_Lite only when you - have many thousands of cache file. Only specific benchs can help - you to choose the perfect value for you. Maybe, 1 or 2 is a good start. + Don't cache the method call when its result is null </entry> </row> </tbody> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml diff -u peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml:1.3 peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml:1.4 --- peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml:1.3 Fri Jun 24 17:24:10 2005 +++ peardoc/en/package/caching/cache-lite/cache-lite-function/call.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="package.default.cache-lite.cache-lite-function.call"> <refnamediv> <refname><function>Cache_Lite_Function::call</function></refname> @@ -112,8 +112,7 @@ </example> <para> If you try to use Cache_Lite_Function with $this object ($cache->call('this->method',...) - for example), have a look first at : - <ulink url="http://pear.php.net/bugs/bug.php?id=660">this bug</ulink> + for example), have a look first at the last example of this page. </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite-function.call.example3"> @@ -150,6 +149,54 @@ </programlisting> </example> </refsect1> + <refsect1 id="package.caching.cache-lite.cache-lite-function.call.example4"> + &title.example; + <example> + <title>another using with a method (how to use cache $this->method() calls)</title> + <programlisting role="php"> + <![CDATA[ +<?php + +// Since Cache_Lite-1.7.0beta2 + +require_once('Cache/Lite/Function.php'); + +$options = array( + 'cacheDir' => '/tmp/', + 'lifeTime' => 3600 +); + +$obj = new foo($options); + +class foo +{ + + var $test; + + function foo($options) + { + $cache = new Cache_Lite_Function($options); + $this->test = 'foobar'; + $cache->call(array(&$this, 'method_bar'), 12, 45); + } + + function method_bar($arg1, $arg2) + { + echo "\$this->test = $this->test and this is the output of the method \$this->method_bar($arg1, $arg2) !<br>"; + return "\$this->test = $this->test and this is the result of the method \$this->method_bar($arg1, $arg2) !<br>"; + } + +} + +?> + ]]> + </programlisting> + </example> + <para> + So, for method calls, the best way is to use array(&$object, 'nameOfTheMethod') as first argument instead + of '$object->nameOfTheMethod' which doesn't work with "$this" for example. + </para> + </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml?r1=1.3&r2=1.4&diff_format=u Index: peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml diff -u peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml:1.3 peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml:1.4 --- peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml:1.3 Thu Nov 24 18:19:59 2005 +++ peardoc/en/package/caching/cache-lite/cache-lite-output/cache_lite_output.xml Tue Feb 7 23:17:59 2006 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <refentry id="package.default.cache-lite.cache-lite-output.cache-lite-output"> <refnamediv> <refname>constructor <function>Cache_Lite_Output::Cache_Lite_Output</function></refname> @@ -34,264 +34,12 @@ </term> <listitem> <para> - associative array to set a lot of options + associative array to set a lot of options (see Cache_Lite constructor for details) </para> </listitem> </varlistentry> </variablelist> </para> - <para> - <table> - <title></title> - <tgroup cols="4"> - <thead> - <row> - <entry>Option</entry> - <entry>Data Type</entry> - <entry>Default Value</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry> - cacheDir - </entry> - <entry> - &type.string; - </entry> - <entry> - /tmp/ - </entry> - <entry> - directory where to put the cache file (with a trailing slash at the end) - </entry> - </row> - <row> - <entry> - caching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable caching - </entry> - </row> - <row> - <entry> - lifeTime - </entry> - <entry> - &type.int; - </entry> - <entry> - 3600 - </entry> - <entry> - cache lifetime in seconds (since 1.6.0beta 1, you can use a null value for an eternal cache lifetime) - </entry> - </row> - <row> - <entry> - fileLocking - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable fileLocking (can avoid cache corruption under bad - circumstances) - </entry> - </row> - <row> - <entry> - writeControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable write control (enable write control will lightly slow - the cache writing but not the cache reading, write control can detect - some corrupt cache files but maybe it's not a perfect control) - </entry> - </row> - <row> - <entry> - readControl - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - enable / disable read control (if enabled, a control key is embeded - in cache file and this key is compared with the one calculated after - the reading) - </entry> - </row> - <row> - <entry> - readControlType - </entry> - <entry> - &type.string; - </entry> - <entry> - crc32 - </entry> - <entry> - Type of read control (only if read control is enabled). Must be 'md5' - (for a md5 hash control (best but slowest)), 'crc32' (for a crc32 hash - control (lightly less safe but faster)) or 'strlen' (for a length only - test (fastest)) - </entry> - </row> - <row> - <entry> - pearErrorMode - </entry> - <entry> - &type.int; - </entry> - <entry> - CACHE_LITE_ERROR_RETURN - </entry> - <entry> - pear error mode (when raiseError is called) (CACHE_LITE_ERROR_RETURN - for just returning a PEAR_Error object or CACHE_LITE_ERROR_DIE for - immediate stop of the script (good for debug)) - </entry> - </row> - <row> - <entry> - fileNameProtection - </entry> - <entry> - &type.bool; - </entry> - <entry> - &true; - </entry> - <entry> - file Name protection (if set to true, you can use any cache id or - group name, if set to false, it can be faster but cache ids and group - names will be used directly in cache file names so be carefull with - special characters...) - </entry> - </row> - <row> - <entry> - automaticSerialization - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable automatic serialization (it can be used to save - directly datas which aren't strings but it's slower) - </entry> - </row> - <row> - <entry> - memoryCaching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable "Memory Caching" (NB : there is - no lifetime for memory caching, only the end of the script) - </entry> - </row> - <row> - <entry> - onlyMemoryCaching - </entry> - <entry> - &type.bool; - </entry> - <entry> - &false; - </entry> - <entry> - enable / disable "Only Memory Caching" (if enabled, - files are not used anymore) - </entry> - </row> - <row> - <entry> - memoryCachingLimit - </entry> - <entry> - &type.int; - </entry> - <entry> - 1000 - </entry> - <entry> - max number of records to store into memory caching - </entry> - </row> - <row> - <entry> - automaticCleaningFactor - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Disable / Tune the automatic cleaning process. The - automatic cleaning process destroy too old (for the given life time) - cache files when a new cache file is written. 0 means "no automatic - cache cleaning", 1 means "systematic cache cleaning" (slow), x>1 means - "automatic cleaning randomly 1 times on x cache writes". A value - between 20 and 200 is maybe a good start. - </entry> - </row> - <row> - <entry> - hashedDirectoryLevel - </entry> - <entry> - &type.int; - </entry> - <entry> - 0 - </entry> - <entry> - Set the hashed directory structure level. 0 means - "no hashed directory structure", 1 means "one level of directory", 2 - means "two levels"... This option can speed up Cache_Lite only when you - have many thousands of cache file. Only specific benchs can help - you to choose the perfect value for you. Maybe, 1 or 2 is a good start. - </entry> - </row> - </tbody> - </tgroup> - </table> - </para> </refsect1> <refsect1 id="package.default.cache-lite.cache-lite-output.cache-lite-output.note"> http://cvs.php.net/viewcvs.cgi/peardoc/en/package/caching/cache-lite/cache-lite/extendlife.xml?view=markup&rev=1.1 Index: peardoc/en/package/caching/cache-lite/cache-lite/extendlife.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/extendlife.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.extend-life"> <refnamediv> <refname><function>Cache_Lite::extendLife</function></refname> <refpurpose>Extend the life of a valid cache file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Cache/Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>Cache_Lite::extendLife</function></funcdef> <paramdef/> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.extend-life.desc"> &title.desc; <para> [since Cache_Lite-1.7.0beta2] Extend the life of an existent cache file. The cache file is "touched", so it starts a new lifetime period. See <ulink url="http://pear.php.net/bugs/bug.php?id=6681">this feature request</ulink> for more details. </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.extend-life.throws"> &title.throws; &noexceptions; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.extend-life.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.extend-life.example"> &title.example; <example> <title>Classical use</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array( 'cacheDir' => '/tmp/', 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE ); $cache = new Cache_Lite($options); $id = 'foo'; if (!($data = $cache->get($id))) { // the cache is not hit ! $data = '123456789'; $cache->save($data); } else { // the cache is hit ! if (isset($_GET['extend'])) { $cache->extendLife(); } } echo($data); ?> ]]> </programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->