예제 #1
0
 public function testGetPath()
 {
     $resources = new Resources();
     foreach ($this->types as $type) {
         $path = $resources->getPath($type);
         $this->assertTrue(file_exists($path), 'Returns valid path.');
         $this->assertTrue(is_dir($path), 'Returns directory.');
     }
 }
예제 #2
0
파일: Plugin.php 프로젝트: tedivm/spark
 public function __construct()
 {
     $className = get_class($this);
     $classNameParts = explode('\\', $className);
     $classNamePartCount = count($classNameParts);
     $this->name = $classNameParts[$classNamePartCount - 2];
     $resources = new Resources();
     $this->directory = $resources->getPath('plugins') . $this->name . '/';
     $this->loadTemplateFiles();
 }
예제 #3
0
파일: Create.php 프로젝트: tedivm/spark
 protected function getPlugins($package)
 {
     $resources = new Resources();
     $configPath = $resources->getPath('config');
     $packages = json_decode(file_get_contents($configPath . 'packages.json'), true);
     if (!isset($packages[$package])) {
         throw new \RuntimeException('Not a supported type.');
     }
     return $packages[$package];
 }