コード例 #1
0
 public function testWriteAndRead()
 {
     $config = new Config(array('default' => array('test' => 'foo')));
     $this->writer->toFile($this->getTestAssetFileName(), $config);
     $config = $this->reader->fromFile($this->getTestAssetFileName());
     $this->assertEquals('foo', $config['default']['test']);
 }
コード例 #2
0
 /**
  * Read from a file and create an array
  *
  * @param string $filename Filename
  *
  * @return array
  */
 public function fromFile($filename)
 {
     $absFilename = realpath($filename);
     $mtime = @filemtime($absFilename);
     $key = $this->generateKey($mtime . $absFilename);
     if ($this->storage->hasItem($key)) {
         return $this->storage->getItem($key);
     }
     $config = $this->reader->fromFile($filename);
     $this->storage->setItem($key, $config);
     return $config;
 }
コード例 #3
0
 public function testFromFile()
 {
     $config = $this->reader->fromFile($this->getTestAssetPath('include-base'));
     $this->assertEquals('foo', $config['foo']);
 }
コード例 #4
0
ファイル: App.php プロジェクト: ryaan-anthony/deployable
 /**
  * Get an array of build config
  * @return array
  */
 protected function getBuilds()
 {
     $buildFile = $this->getBuildFile();
     $config = $this->config->fromFile($buildFile);
     return isset($config['build']) ? $config['build'] : [];
 }