cvs: peardoc /en/package/caching/cache-lite/cache-lite cache_lite.xml clean.xml get.xml lastmodified.xml raiseerror.xml remove.xml save.xml
setlifetime.xml settodebug.xml
| From: | Fabien MARTY | Date: | Sat, 24 Apr 2004 11:46:24 +0000 |
| Subject: | cvs: peardoc /en/package/caching/cache-lite/cache-lite cache_lite.xml clean.xml get.xml lastmodified.xml raiseerror.xml remove.xml save.xml setlifetime.xml settodebug.xml |
||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-3702@lists.php.net to get a copy of this message | ||
fab Sat Apr 24 07:46:24 2004 EDT
Added files:
/peardoc/en/package/caching/cache-lite/cache-lite cache_lite.xml
clean.xml get.xml
lastmodified.xml
raiseerror.xml
remove.xml
save.xml
setlifetime.xml
settodebug.xml
Log:
First commit of a part of the Cache_Lite peardoc2 documentation. I'm not familiar with
peardoc2 at all and this is a work in progress. So comments are welcome !
http://cvs.php.net/co.php/peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.cache-lite"> <refnamediv> <refname>constructor <function>Cache_Lite::Cache_Lite</function></refname> <refpurpose>Constructor</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void constructor <function>Cache_Lite::Cache_Lite</function></funcdef> <paramdef>array <parameter> <optional>$options = array(NULL)</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.cache-lite.desc"> &title.desc; <para> The constructor of the Cache_Lite core class. You can give an associative array as an argument to set a lot of options. </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.cache-lite.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.array; <parameter>$options</parameter> </term> <listitem> <para> associative array to set a lot of options </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 </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> [BETA QUALITY] 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> [BETA QUALITY] 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> [BETA QUALITY] max number of records to store into memory caching </entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.cache-lite.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.cache-lite.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.cache-lite.example"> &title.example; <example> <title>Using most common options</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array( 'cacheDir' => '/tmp/', 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE ); $cache = Cache_Lite($options); ?> ]]> </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/clean.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/clean.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/clean.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.clean"> <refnamediv> <refname><function>Cache_Lite::clean</function></refname> <refpurpose>Clean the cache</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>boolean <function>Cache_Lite::clean</function></funcdef> <paramdef>string <parameter> <optional>$group = &false;</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.clean.desc"> &title.desc; <para> if no group is specified all cache files will be destroyed ; else only cache files of the specified group will be destroyed </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.clean.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$group</parameter> </term> <listitem> <para> name of the cache group </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.clean.returns"> &title.returns; <para> <emphasis>returns</emphasis> true if no problem </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.clean.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.clean.example"> &title.example; <example> <title>classical using</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array('cacheDir' => '/tmp/'); $cache = Cache_Lite($options); $cache->clean(); ?> ]]> </programlisting> </example> <para> This example cleans all of the cache files. </para> </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/get.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/get.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/get.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.get"> <refnamediv> <refname><function>Cache_Lite::get</function></refname> <refpurpose>Test if a cache is available and (if yes) return it</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>Cache_Lite::get</function></funcdef> <paramdef>string <parameter>$id</parameter></paramdef> <paramdef>string <parameter> <optional>$group = 'default'</optional></parameter></paramdef> <paramdef>boolean <parameter> <optional>$doNotTestCacheValidity = &false;</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.get.desc"> &title.desc; <para> One of the main method of Cache_Lite : test the validity of a cache file and return it if it's available (&false; else) </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.get.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$id</parameter> </term> <listitem> <para> cache id </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$group</parameter> </term> <listitem> <para> name of the cache group </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.bool; <parameter>$doNotTestCacheValidity</parameter> </term> <listitem> <para> if set to &true;, the cache validity won't be tested </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.get.returns"> &title.returns; <para> <emphasis>returns</emphasis> data of the cache (or false if no cache available) </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.get.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.get.example"> &title.example; <example> <title>classical using</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array( 'cacheDir' => '/tmp/', 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE ); $cache = Cache_Lite($options); if ($data = $cache->get('id_of_the_page')) { // Cache hit ! // Content is in $data // (...) } else { // No valid cache found (you have to make and save the page) // (...) } ?> ]]> </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/lastmodified.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/lastmodified.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/lastmodified.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.lastmodified"> <refnamediv> <refname><function>Cache_Lite::lastModified</function></refname> <refpurpose>Return the cache last modification time</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>int <function>Cache_Lite::lastModified</function></funcdef> <paramdef></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.lastmodified.desc"> &title.desc; <para>[ONLY FOR CACHE_LITE HACKERS] return the cache last modification time</para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.lastmodified.returns"> &title.returns; <para> <emphasis>returns</emphasis> last modification time </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.lastmodified.note"> &title.note; ¬e.notstatic; </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/raiseerror.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/raiseerror.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/raiseerror.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.raiseerror"> <refnamediv> <refname><function>Cache_Lite::raiseError</function></refname> <refpurpose>Trigger a PEAR error</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>Cache_Lite::raiseError</function></funcdef> <paramdef>string <parameter>$msg</parameter></paramdef> <paramdef>int <parameter>$code</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.raiseerror.desc"> &title.desc; <para> include dynamically the PEAR.php file and trigger a PEAR error </para> <para> To improve performances, the PEAR.php file is included dynamically. The file is so included only when an error is triggered. So, in most cases, the file isn't included and perfs are much better. </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.raiseerror.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$msg</parameter> </term> <listitem> <para> error message </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.int; <parameter>$code</parameter> </term> <listitem> <para> error code </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.raiseerror.note"> &title.note; ¬e.notstatic; </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/remove.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/remove.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/remove.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.remove"> <refnamediv> <refname><function>Cache_Lite::remove</function></refname> <refpurpose>Remove a cache file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>boolean <function>Cache_Lite::remove</function></funcdef> <paramdef>string <parameter>$id</parameter></paramdef> <paramdef>string <parameter> <optional>$group = 'default'</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.remove.desc"> &title.desc; <para> remove the given cache file (specified with its id and group) </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.remove.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$id</parameter> </term> <listitem> <para> cache id </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$group</parameter> </term> <listitem> <para> name of the cache group </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.remove.returns"> &title.returns; <para> <emphasis>returns</emphasis> true if no problem </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.remove.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.remove.example"> &title.example; <example> <title>classical using</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array( 'cacheDir' => '/tmp/', 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE ); $cache = Cache_Lite($options); $cache->remove('id_of_the_page'); if ($data = $cache->get('id_of_the_page')) { // Cache hit ! // [IMPOSSIBLE !] } else { // No valid cache found (you have to make and save the page) $data = '<html><head><title>test</title></head><body><p>this is a test</p></body></html>'; $cache->save($data); } ?> ]]> </programlisting> </example> <para> This is a dummy example because the cache is destroyed at the beginning of the script ! So the first case of the if statement is impossible. </para> </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/save.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/save.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/save.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.save"> <refnamediv> <refname><function>Cache_Lite::save</function></refname> <refpurpose>Save some data in a cache file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>boolean <function>Cache_Lite::save</function></funcdef> <paramdef>string <parameter>$data</parameter></paramdef> <paramdef>string <parameter> <optional>$id = NULL</optional></parameter></paramdef> <paramdef>string <parameter> <optional>$group = 'default'</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.save.desc"> &title.desc; <para> save the given data (which has to be a string if automaticSerialization is set to &false; (default)). </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.save.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$data</parameter> </term> <listitem> <para> data to put in a cache file (can be another type than strings if automaticSerialization is &false; (default)). </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$id</parameter> </term> <listitem> <para> cache id </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$group</parameter> </term> <listitem> <para> name of the cache group </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.save.returns"> &title.returns; <para> <emphasis>returns</emphasis> true if no problem </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.save.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.save.example"> &title.example; <example> <title>classical using</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array( 'cacheDir' => '/tmp/', 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE ); $cache = Cache_Lite($options); if ($data = $cache->get('id_of_the_page')) { // Cache hit ! // Content is in $data echo($data); } else { // No valid cache found (you have to make and save the page) $data = '<html><head><title>test</title></head><body><p>this is a test</p></body></html>'; $cache->save($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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/setlifetime.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/setlifetime.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/setlifetime.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.setlifetime"> <refnamediv> <refname><function>Cache_Lite::setLifeTime</function></refname> <refpurpose>Set a new life time</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>Cache_Lite::setLifeTime</function></funcdef> <paramdef>int <parameter>$newLifeTime</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.setlifetime.desc"> &title.desc; <para> change the cache life time </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.setlifetime.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.int; <parameter>$newLifeTime</parameter> </term> <listitem> <para> new life time (in seconds) </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.setlifetime.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.setlifetime.note"> &title.note; ¬e.notstatic; </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/settodebug.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/settodebug.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/settodebug.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.settodebug"> <refnamediv> <refname><function>Cache_Lite::setToDebug</function></refname> <refpurpose>Set to debug mode</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>Cache_Lite::setToDebug</function></funcdef> <paramdef></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.settodebug.desc"> &title.desc; <para>when an error is found, the script will stop and the message will be displayed (in debug mode only) ; same effect than pearErrorMode option in the constructor</para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.settodebug.note"> &title.note; ¬e.notstatic; </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/cache_lite.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.cache-lite"> <refnamediv> <refname>constructor <function>Cache_Lite::Cache_Lite</function></refname> <refpurpose>Constructor</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void constructor <function>Cache_Lite::Cache_Lite</function></funcdef> <paramdef>array <parameter> <optional>$options = array(NULL)</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.cache-lite.desc"> &title.desc; <para> The constructor of the Cache_Lite core class. You can give an associative array as an argument to set a lot of options. </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.cache-lite.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.array; <parameter>$options</parameter> </term> <listitem> <para> associative array to set a lot of options </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 </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> [BETA QUALITY] 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> [BETA QUALITY] 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> [BETA QUALITY] max number of records to store into memory caching </entry> </row> </tbody> </tgroup> </table> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.cache-lite.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.cache-lite.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.cache-lite.example"> &title.example; <example> <title>Using most common options</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array( 'cacheDir' => '/tmp/', 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE ); $cache = Cache_Lite($options); ?> ]]> </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/clean.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/clean.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/clean.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.clean"> <refnamediv> <refname><function>Cache_Lite::clean</function></refname> <refpurpose>Clean the cache</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>boolean <function>Cache_Lite::clean</function></funcdef> <paramdef>string <parameter> <optional>$group = &false;</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.clean.desc"> &title.desc; <para> if no group is specified all cache files will be destroyed ; else only cache files of the specified group will be destroyed </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.clean.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$group</parameter> </term> <listitem> <para> name of the cache group </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.clean.returns"> &title.returns; <para> <emphasis>returns</emphasis> true if no problem </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.clean.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.clean.example"> &title.example; <example> <title>classical using</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array('cacheDir' => '/tmp/'); $cache = Cache_Lite($options); $cache->clean(); ?> ]]> </programlisting> </example> <para> This example cleans all of the cache files. </para> </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/get.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/get.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/get.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.get"> <refnamediv> <refname><function>Cache_Lite::get</function></refname> <refpurpose>Test if a cache is available and (if yes) return it</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>string <function>Cache_Lite::get</function></funcdef> <paramdef>string <parameter>$id</parameter></paramdef> <paramdef>string <parameter> <optional>$group = 'default'</optional></parameter></paramdef> <paramdef>boolean <parameter> <optional>$doNotTestCacheValidity = &false;</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.get.desc"> &title.desc; <para> One of the main method of Cache_Lite : test the validity of a cache file and return it if it's available (&false; else) </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.get.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$id</parameter> </term> <listitem> <para> cache id </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$group</parameter> </term> <listitem> <para> name of the cache group </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.bool; <parameter>$doNotTestCacheValidity</parameter> </term> <listitem> <para> if set to &true;, the cache validity won't be tested </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.get.returns"> &title.returns; <para> <emphasis>returns</emphasis> data of the cache (or false if no cache available) </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.get.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.get.example"> &title.example; <example> <title>classical using</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array( 'cacheDir' => '/tmp/', 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE ); $cache = Cache_Lite($options); if ($data = $cache->get('id_of_the_page')) { // Cache hit ! // Content is in $data // (...) } else { // No valid cache found (you have to make and save the page) // (...) } ?> ]]> </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/lastmodified.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/lastmodified.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/lastmodified.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.lastmodified"> <refnamediv> <refname><function>Cache_Lite::lastModified</function></refname> <refpurpose>Return the cache last modification time</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>int <function>Cache_Lite::lastModified</function></funcdef> <paramdef></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.lastmodified.desc"> &title.desc; <para>[ONLY FOR CACHE_LITE HACKERS] return the cache last modification time</para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.lastmodified.returns"> &title.returns; <para> <emphasis>returns</emphasis> last modification time </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.lastmodified.note"> &title.note; ¬e.notstatic; </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/raiseerror.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/raiseerror.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/raiseerror.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.raiseerror"> <refnamediv> <refname><function>Cache_Lite::raiseError</function></refname> <refpurpose>Trigger a PEAR error</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>Cache_Lite::raiseError</function></funcdef> <paramdef>string <parameter>$msg</parameter></paramdef> <paramdef>int <parameter>$code</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.raiseerror.desc"> &title.desc; <para> include dynamically the PEAR.php file and trigger a PEAR error </para> <para> To improve performances, the PEAR.php file is included dynamically. The file is so included only when an error is triggered. So, in most cases, the file isn't included and perfs are much better. </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.raiseerror.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$msg</parameter> </term> <listitem> <para> error message </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.int; <parameter>$code</parameter> </term> <listitem> <para> error code </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.raiseerror.note"> &title.note; ¬e.notstatic; </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/remove.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/remove.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/remove.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.remove"> <refnamediv> <refname><function>Cache_Lite::remove</function></refname> <refpurpose>Remove a cache file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>boolean <function>Cache_Lite::remove</function></funcdef> <paramdef>string <parameter>$id</parameter></paramdef> <paramdef>string <parameter> <optional>$group = 'default'</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.remove.desc"> &title.desc; <para> remove the given cache file (specified with its id and group) </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.remove.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$id</parameter> </term> <listitem> <para> cache id </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$group</parameter> </term> <listitem> <para> name of the cache group </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.remove.returns"> &title.returns; <para> <emphasis>returns</emphasis> true if no problem </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.remove.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.remove.example"> &title.example; <example> <title>classical using</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array( 'cacheDir' => '/tmp/', 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE ); $cache = Cache_Lite($options); $cache->remove('id_of_the_page'); if ($data = $cache->get('id_of_the_page')) { // Cache hit ! // [IMPOSSIBLE !] } else { // No valid cache found (you have to make and save the page) $data = '<html><head><title>test</title></head><body><p>this is a test</p></body></html>'; $cache->save($data); } ?> ]]> </programlisting> </example> <para> This is a dummy example because the cache is destroyed at the beginning of the script ! So the first case of the if statement is impossible. </para> </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/save.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/save.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/save.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.save"> <refnamediv> <refname><function>Cache_Lite::save</function></refname> <refpurpose>Save some data in a cache file</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>boolean <function>Cache_Lite::save</function></funcdef> <paramdef>string <parameter>$data</parameter></paramdef> <paramdef>string <parameter> <optional>$id = NULL</optional></parameter></paramdef> <paramdef>string <parameter> <optional>$group = 'default'</optional></parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.save.desc"> &title.desc; <para> save the given data (which has to be a string if automaticSerialization is set to &false; (default)). </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.save.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.string; <parameter>$data</parameter> </term> <listitem> <para> data to put in a cache file (can be another type than strings if automaticSerialization is &false; (default)). </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$id</parameter> </term> <listitem> <para> cache id </para> </listitem> </varlistentry> </variablelist> <variablelist> <varlistentry> <term> &type.string; <parameter>$group</parameter> </term> <listitem> <para> name of the cache group </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.save.returns"> &title.returns; <para> <emphasis>returns</emphasis> true if no problem </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.save.note"> &title.note; ¬e.notstatic; </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.save.example"> &title.example; <example> <title>classical using</title> <programlisting role="php"> <![CDATA[ <?php require_once "Cache/Lite.php"; $options = array( 'cacheDir' => '/tmp/', 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE ); $cache = Cache_Lite($options); if ($data = $cache->get('id_of_the_page')) { // Cache hit ! // Content is in $data echo($data); } else { // No valid cache found (you have to make and save the page) $data = '<html><head><title>test</title></head><body><p>this is a test</p></body></html>'; $cache->save($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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/setlifetime.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/setlifetime.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/setlifetime.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.setlifetime"> <refnamediv> <refname><function>Cache_Lite::setLifeTime</function></refname> <refpurpose>Set a new life time</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>Cache_Lite::setLifeTime</function></funcdef> <paramdef>int <parameter>$newLifeTime</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.setlifetime.desc"> &title.desc; <para> change the cache life time </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.setlifetime.param"> &title.param; <para> <variablelist> <varlistentry> <term> &type.int; <parameter>$newLifeTime</parameter> </term> <listitem> <para> new life time (in seconds) </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.setlifetime.throws"> &title.throws; <para> <emphasis>throws</emphasis> no exceptions thrown </para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.setlifetime.note"> &title.note; ¬e.notstatic; </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/co.php/peardoc/en/package/caching/cache-lite/cache-lite/settodebug.xml?r=1.1&p=1 Index: peardoc/en/package/caching/cache-lite/cache-lite/settodebug.xml +++ peardoc/en/package/caching/cache-lite/cache-lite/settodebug.xml <!-- $Revision: 1.1 $ --> <refentry id="package.caching.cache-lite.cache-lite.settodebug"> <refnamediv> <refname><function>Cache_Lite::setToDebug</function></refname> <refpurpose>Set to debug mode</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcsynopsisinfo> require_once 'Lite.php'; </funcsynopsisinfo> <funcprototype> <funcdef>void <function>Cache_Lite::setToDebug</function></funcdef> <paramdef></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.caching.cache-lite.cache-lite.settodebug.desc"> &title.desc; <para>when an error is found, the script will stop and the message will be displayed (in debug mode only) ; same effect than pearErrorMode option in the constructor</para> </refsect1> <refsect1 id="package.caching.cache-lite.cache-lite.settodebug.note"> &title.note; ¬e.notstatic; </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 -->