/**
  * 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());
 }
示例#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;
 }
示例#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);
 }
示例#4
0
文件: Environment.php 项目: bolt/bolt
 private function getVersionFileName()
 {
     return dirname(dirname($this->cache->getDirectory())) . '/.version';
 }