예제 #1
0
 public function getFromReference($reference)
 {
     $reference .= '::';
     $this->_referenceParser->parse($reference);
     $path = $this->_referenceParser->getFullPath('resources/migrations');
     if (!$this->_filesystem->exists($path)) {
         return array();
     }
     $files = $this->_getFinder()->files()->in($path);
     $migrations = array();
     foreach ($files as $file) {
         if ($file->isFile()) {
             $fileReference = 'cog://' . $reference . 'resources/migrations/' . $file->getBasename();
             $key = $this->_getKey($fileReference);
             $migrations[$key] = $this->resolve($file, $fileReference);
         }
     }
     return $migrations;
 }
예제 #2
0
 /**
  * {@inheritDoc}
  *
  * @param ReferenceParserInterface $parser The reference parser
  * @param string                   $source     An absolute path
  * @param array                    $filters    An array of filters
  * @param string                   $sourceRoot The source asset root directory
  * @param string                   $sourcePath The source asset path
  * @param array                    $vars
  *
  * @throws \InvalidArgumentException If the supplied root doesn't match the
  *                                   source when guessing the path
  */
 public function __construct(ReferenceParserInterface $parser, $source, $filters = array(), $sourceRoot = null, $sourcePath = null, array $vars = array())
 {
     $source = $parser->parse($source)->getFullPath();
     return parent::__construct($source, $filters, $sourceRoot, $sourcePath, $vars);
 }