A extension of Query that is able to store results in shared memory (via the apc_* functions) so that they can be retieved for future use with minimal performance impact.
Наследование: extends Query
Пример #1
0
 public function testCache()
 {
     if (!ini_get('apc.enable_cli')) {
         $this->markTestSkipped('The APC extension is not enabled on the command line. Set apc.enable_cli=1.');
     }
     $path = __DIR__ . '/fixtures/datastore/querytest';
     $config = new Config($path . '/');
     $repo = new Repository('countries', $config);
     $query = new CachedQuery($repo);
     $total = 0;
     for ($i = 0; $i < 100; $i++) {
         $start = microtime(true);
         $query->where('cca2', '==', 'GB');
         $query->execute();
         $total += microtime(true) - $start;
     }
 }