Exemplo n.º 1
0
 /**
  * Generates an instance of the cache store that can be used for testing.
  *
  * Returns an instance of the cache store, or false if one cannot be created.
  *
  * @param cache_definition $definition
  * @return cachestore_file
  */
 public static function initialise_test_instance(cache_definition $definition)
 {
     $name = 'File test';
     $path = make_cache_directory('cachestore_file_test');
     $cache = new cachestore_file($name, array('path' => $path));
     if ($cache->is_ready()) {
         $cache->initialise($definition);
     }
     return $cache;
 }