Development

Changeset 6361

You must first sign up to be able to contribute.

Changeset 6361

Show
Ignore:
Timestamp:
12/07/07 15:16:33 (1 year ago)
Author:
fabien
Message:

fixed sfProcessCache eaccelerator delete also cached scripts not only cached data (closes #1964)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/cache/sfEAcceleratorCache.class.php

    r4586 r6361  
    107107    } 
    108108 
    109     eaccelerator_clean(); 
     109    $infos = eaccelerator_list_keys(); 
     110    if (is_array($infos)) 
     111    { 
     112      foreach ($infos as $info) 
     113      { 
     114        if (false !== strpos($info['name'], $this->prefix)) 
     115        { 
     116          // eaccelerator bug (http://eaccelerator.net/ticket/287) 
     117          $key = 0 === strpos($info['name'], ':') ? substr($info['name'], 1) : $info['name']; 
     118          if (!eaccelerator_rm($key)) 
     119          { 
     120            return false; 
     121          } 
     122        } 
     123      } 
     124    } 
     125 
     126    return true; 
    110127  } 
    111128 
  • trunk/test/unit/cache/sfEAcceleratorCacheTest.php

    r4957 r6361  
    1414$t = new lime_test($plan, new lime_output_color()); 
    1515 
    16 if (!function_exists('eaccelerator_put') || !ini_get('eaccelerator.enable')) 
     16try 
    1717{ 
    18   $t->skip('EAccelerator needed to run these tests', $plan); 
    19   return; 
     18  $cache = new sfEAcceleratorCache(); 
     19
     20catch (sfInitializationException $e) 
     21
     22  $t->skip($e->getMessage(), $plan); 
    2023} 
    2124