Ejemplo n.º 1
0
 function testCacheInit()
 {
     define('CACHE', tempnam("/tmp", "notoj_test"));
     unlink(CACHE);
     $this->assertFalse(is_file(CACHE));
     Notoj::enableCache(CACHE);
     $this->assertTrue(is_file(CACHE));
     $this->assertEquals("<?php\n", file_get_contents(CACHE));
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function setCacheDir($cacheDir)
 {
     parent::setCacheDir($cacheDir);
     \Notoj\Notoj::enableCache($cacheDir . DIRECTORY_SEPARATOR . "_annotations.php");
 }
Ejemplo n.º 3
0
 protected function generateIfNeeded()
 {
     if ($this->devel || !is_file($this->loader)) {
         Notoj::enableCache($this->loader . ".tmp");
         $watcher = new Watch($this->loader . ".lock");
         if ($watcher->hasChanged()) {
             new Generate($this, $watcher);
             $this->generate = true;
         }
     }
 }