public function load($resource, $type = null) { $locator = new PlatformResourceLocator([$this->kernel->getRootDir() . '/../src', $this->kernel->getRootDir() . '/../vendor']); $resources = $locator->locate('routing.yml'); $collection = new RouteCollection(); foreach ($resources as $resource) { $collection->addCollection($this->loader->load($resource)); } return $collection; }
protected function autoloadBundles() { $locator = new PlatformResourceLocator(array($this->getRootDir() . '/../src', $this->getRootDir() . '/../vendor')); $files = $locator->locate('autoload.yml'); $bundles = array(); foreach ($files as $file) { $import = Yaml::parse($file); if (!empty($import)) { if (!empty($import['bundle'])) { $bundles = array_merge($bundles, $this->getBundleConfig($import['bundle'])); } } } uasort($bundles, array($this, 'prioritizeBundles')); return $bundles; }