Welcome Guest, Not a member yet? Register   Sign In
Codeigniter caching
#2

[eluser]gon[/eluser]
I had some requirements that CI cache wouldn't solve, so I started using Zend_Cache, the cache library from Zend Framework.

Check the Zend user manual for details on using this lib.

Integrating it with CI is quite easy. You can just instantiate a cache object, or use this Zend component loader.

This code is not mine, but I don't remember where I took it. Could be on the WIKI.

Code:
<?php if (!defined('BASEPATH')) {exit('No direct script access allowed');}

/**
* Zend Framework Loader
*
* Put the 'Zend' folder (unpacked from the Zend Framework package, under 'Library')
* in CI installation's 'application/libraries' folder
* You can put it elsewhere but remember to alter the script accordingly
*
* Usage:
*   1) $this->load->library('zend', 'Zend/Package/Name');
*   or
*   2) $this->load->library('zend');
*      then $this->zend->load('Zend/Package/Name');
*
* * the second usage is useful for autoloading the Zend Framework library
* * Zend/Package/Name does not need the '.php' at the end
*/
class CI_Zend
{
    /**
     * Constructor
     *
     * @param    string $class class name
     */
    function __construct($class = NULL)
    {        

        if ($class)
        {
            require_once (string) $class . EXT;
            log_message('debug', "Zend Class $class Loaded");
        }
        else
        {
            log_message('debug', "Zend Class Initialized");
        }
    }

    /**
     * Zend Class Loader
     *
     * @param    string $class class name
     */
    function load($class)
    {
        require_once (string) $class . EXT;
        log_message('debug', "Zend Class $class Loaded");
    }
}

?>


Messages In This Thread
Codeigniter caching - by El Forum - 08-18-2008, 12:07 PM
Codeigniter caching - by El Forum - 08-19-2008, 02:55 AM
Codeigniter caching - by El Forum - 08-23-2008, 12:03 PM
Codeigniter caching - by El Forum - 08-23-2008, 12:27 PM
Codeigniter caching - by El Forum - 08-23-2008, 12:50 PM
Codeigniter caching - by El Forum - 08-23-2008, 02:56 PM
Codeigniter caching - by El Forum - 08-24-2008, 01:36 PM
Codeigniter caching - by El Forum - 08-24-2008, 11:38 PM
Codeigniter caching - by El Forum - 08-25-2008, 05:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB