Esempio n. 1
0
 /**
  * Checks if giving a relative path results in the same path under water.
  */
 public function testCacheDirLocation()
 {
     $cacheDirLocation = $this->cache->getDirectory();
     $filesystem = new Filesystem();
     $relative = $filesystem->makePathRelative($cacheDirLocation, __DIR__);
     $newCache = new Cache($relative);
     $this->assertEquals($cacheDirLocation, $newCache->getDirectory());
 }
Esempio n. 2
0
 /**
  * Check if the cache version matches Bolt's current version
  *
  * @return boolean TRUE  - versions match
  *                 FALSE - versions don't match
  */
 protected function checkCacheVersion()
 {
     $file = $this->cache->getDirectory() . '/.version';
     if (!file_exists($file)) {
         return false;
     }
     $version = md5($this->boltVersion . $this->boltName);
     $cached = file_get_contents($file);
     if ($version === $cached) {
         return true;
     }
     return false;
 }
Esempio n. 3
0
 /**
  * Write our version string out to given cache directory
  */
 protected function updateCacheVersion()
 {
     $version = md5($this->boltVersion);
     file_put_contents($this->cache->getDirectory() . '/.version', $version);
 }
Esempio n. 4
0
 private function getVersionFileName()
 {
     return dirname(dirname($this->cache->getDirectory())) . '/.version';
 }