Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function getAllClassNames()
 {
     if (!$this->locator instanceof AdvancedFileLocatorInterface) {
         throw new \RuntimeException('Locator "%s" must be an instance of "AdvancedFileLocatorInterface".');
     }
     return $this->locator->findAllClasses($this->getExtension());
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function locate($file, $currentPath = null, $first = true)
 {
     if ('@' === $file[0]) {
         return $this->moduleManager->locateResource($file, $this->path, $first);
     }
     return parent::locate($file, $currentPath, $first);
 }
 public function __construct($type = self::CONTAINER, $env = '')
 {
     if (!empty($env)) {
         $env .= '.';
     }
     parent::__construct($env . $type . '.php', FileLocator::VAR_DIR);
 }
Exemplo n.º 4
0
 private function getPackagesJsonData()
 {
     if ($this->cache->contains('packages_json_downloads') !== FALSE) {
         // If we have it in cache, get the packages.json file
         $packagesDataJson = $this->cache->fetch('packages_json_downloads');
         $cacheStatus = 'Hit';
     } else {
         // If we don't have it in cache, find it & load it
         $locator = new FileLocator($this->kernel->getRootDir());
         $locator->locate('packages.json', null, true);
         $packagesDataJson = $locator->getContents();
         $this->cache->save('packages_json_downloads', $packagesDataJson, 86400);
         $cacheStatus = 'Miss';
     }
     // Parse JSON response and discard irrelevant branches
     return json_decode($packagesDataJson, true);
 }
 public function __construct($fileName = self::DEFINITIONS_FILE)
 {
     parent::__construct($fileName, FileLocator::DIST_DIR);
 }