Search code examples
phpcodeigniterapc

Codeigniter Static Wrapper for APC


I wish to create a Static wrapper API for getting and setting values from the APC cache. I'm new to CodeIgniter. The examples on CodeIgniter's page use $this to load the cache driver, which cannot work within a static function. Is there a way to load the driver statically?


Solution

  • I don't know whether It works or not. But just try like following:

    $this->load->driver('some_parent');
    

    And in the static function that you want to use the driver:

    CI =& get_instance();
    CI->some_parent->function();
    

    Hope that help.