Exemple #1
0
 /**
  * @param UniformResourceLocator $locator
  */
 public function setLocator(UniformResourceLocator $locator)
 {
     $this->locator = $locator;
     // Set locator to both streams.
     Stream::setLocator($locator);
     ReadOnlyStream::setLocator($locator);
 }
 public function register(Container $container)
 {
     $self = $this;
     $container['locator'] = function ($c) use($self) {
         $locator = new UniformResourceLocator(ROOT_DIR);
         $self->init($c, $locator);
         return $locator;
     };
     $container['streams'] = function ($c) use($self) {
         $locator = $c['locator'];
         // Set locator to both streams.
         Stream::setLocator($locator);
         ReadOnlyStream::setLocator($locator);
         return new StreamBuilder($this->schemes);
     };
 }
 public function register(Container $container)
 {
     $container['locator'] = function ($c) {
         $locator = new UniformResourceLocator(GRAV_ROOT);
         /** @var Setup $setup */
         $setup = $c['setup'];
         $setup->initializeLocator($locator);
         return $locator;
     };
     $container['streams'] = function ($c) {
         /** @var Setup $setup */
         $setup = $c['setup'];
         /** @var UniformResourceLocator $locator */
         $locator = $c['locator'];
         // Set locator to both streams.
         Stream::setLocator($locator);
         ReadOnlyStream::setLocator($locator);
         return new StreamBuilder($setup->getStreams());
     };
 }
 public function register(Container $container)
 {
     $container['locator'] = function ($c) {
         $locator = new UniformResourceLocator(ROOT_DIR);
         /** @var Config $config */
         $config = $c['config'];
         $config->initializeLocator($locator);
         return $locator;
     };
     $container['streams'] = function ($c) {
         /** @var Config $config */
         $config = $c['config'];
         /** @var UniformResourceLocator $locator */
         $locator = $c['locator'];
         // Set locator to both streams.
         Stream::setLocator($locator);
         ReadOnlyStream::setLocator($locator);
         return new StreamBuilder($config->getStreams($c));
     };
 }