Welcome Guest, Not a member yet? Register   Sign In
Cannot overload cache drivers (memcached)
#3

[eluser]Antoine P.[/eluser]
Actually, I didn't succeed in overloading the driver without modifying the system files. I think you can rewrite the driver by defining the class Cache_memcached in libraries/Cache/drivers/Cache_memcached.php but if you want to overload the class, you can't (or at least I don't know how) do it easilly.

The trick I've found is creating my MY_Cache_memcached class that extend Cache_memcached in libraries/Cache/drivers/Cache_memcached.php. Then, I modified the CI_Driver_Library::_get method and added
Code:
if (class_exists(config_item('subclass_prefix').$child_class))
{
    $child_class = config_item('subclass_prefix').$child_class;
}
before class instanciation. Finally, I hard wrote the Cache_memcached parent class inclusion in MY_Cache_memcached.

You get it?


Messages In This Thread
Cannot overload cache drivers (memcached) - by El Forum - 02-08-2011, 03:34 AM
Cannot overload cache drivers (memcached) - by El Forum - 02-09-2011, 05:57 AM
Cannot overload cache drivers (memcached) - by El Forum - 02-09-2011, 06:09 AM
Cannot overload cache drivers (memcached) - by El Forum - 02-09-2011, 06:29 AM
Cannot overload cache drivers (memcached) - by El Forum - 02-09-2011, 06:42 AM
Cannot overload cache drivers (memcached) - by El Forum - 02-09-2011, 07:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB