EllisLab text mark
Advanced Search
     
Db caching and cache_delete_all()
Posted: 30 October 2007 01:47 PM   [ Ignore ]
Joined: 2007-07-26
33 posts

hi all!

During a short experience with codeigniter caching query system, i found this big problem:
if i use caching_delete_all() it remove directly the cache directory.. and not the directory created into it.

This is a problem because if i use again caching after delete this dir ... i get an error (i try to write into a non existant directory)

could someone help me ?

 Signature 

Jumpzero

 
Posted: 30 October 2007 02:12 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2007-07-26
33 posts

From system/database/DB_cache.php

function delete_all()

    
{
    delete_files
($this->CI->db->cachedir[b]TRUE[/b]);
    


The problem is the TRUE value.. it say to file function to delete also the main directory.

This is a big problem when i don’t know which pages could generate caching.

example: if i need to cache authentication for groups.
I have a function auth() in my authenticate library… and this function check if some groups of a user have access to a page.

The Auth() function is placed in all private pages.. and so it generate X dirs in my cache dir
example, private+page1, private+page2 etc..
So it would be really useful delete all these directories when i update groups.

 Signature 

Jumpzero

 
Posted: 30 October 2007 10:05 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2006-08-11
103 posts

I recall a similar bug being reported when query caching was first released.

Not sure if it got fixed though

 Signature 

Security Code Review