#5976: Clearing XCache stops after first cache cleared
--------------------------+-------------------------------------------------
    Reporter:  oscar      |          Type:  Bug   
      Status:  new        |      Priority:  Medium
   Milestone:  1.2.x.x    |     Component:  Cache 
     Version:  1.2 Final  |      Severity:  Normal
    Keywords:             |   Php_version:  n/a   
Cake_version:             |  
--------------------------+-------------------------------------------------
 I have a server with eight cores, and use the setting "xcache.count = 8"
 for my XCache. The way CakePHP clears the cache in XcacheEngine::clear is
 different from the way XCaches own admin page work, in that it checks the
 return value from xcache_clear_cache.

 Looking at the admin page of XCache, they don't do this:
 http://xcache.lighttpd.net/browser/trunk/admin/xcache.php#L231

 I added this code to XcacheEngine::clear to test clearing the cache
 without checking the return value:

 {{{
 e('cache: '.$i.'  ');
 $info = xcache_info(XC_TYPE_VAR, $i);
 e($info['cached'].' -> ');
 xcache_clear_cache(XC_TYPE_VAR, $i);
 $info = xcache_info(XC_TYPE_VAR, $i);
 e($info['cached']."\n");
 }}}

 It works fine and the caches are clearly emptied when running:

 {{{
 cache: 0  2 -> 0
 cache: 1  2 -> 0
 cache: 2  1 -> 0
 cache: 3  0 -> 0
 cache: 4  0 -> 0
 cache: 5  2 -> 0
 cache: 6  2 -> 0
 cache: 7  1 -> 0
 }}}

 And, here is the function for clearing the cache:

 {{{
         function clearCache() {
                 $check = (isset($this->params['check']) ? true : false);
                 $z = cache::getInstance();
                 $this->out("cleanCache");
                 foreach($z->__config as $key => $val)
                 {
                     if (Cache::clear($check, $key)) {
                             $this->out("cache:  cleared");
                         } else {
                             $this->out("cache:  NOT cleared");
                         }

                 }
         }
 }}}

-- 
Ticket URL: <https://trac.cakephp.org/ticket/5976>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to