Exemplo n.º 1
0
 protected function createExtensionListener(ExtensionInterface $extension)
 {
     $source = $this->publisher->getExtensionPublishSource($extension);
     $me = $this;
     $this->createListener($source, function ($resource) use($me, $extension) {
         $me->publishExtension($extension);
     });
 }
Exemplo n.º 2
0
 public function testNotes()
 {
     $themeBag = $this->getMockThemeBag();
     $publisher = new ThemePublisher($themeBag);
     $publisher->setDispatcher($dispatcher = new Dispatcher());
     $publisher->noting(function ($note) {
         $_SERVER['__theme.publisher.note'] = $note;
     });
     $publisher->note('foo', 'info');
     $this->assertTrue(isset($_SERVER['__theme.publisher.note']));
     $this->assertEquals('<info>foo</info>', $_SERVER['__theme.publisher.note']);
     unset($_SERVER['__theme.publisher.note']);
 }
Exemplo n.º 3
0
 /**
  * Registers the theme publisher that will be used.
  *
  * @return void
  */
 protected function registerThemePublisher()
 {
     $this->app['theme.publisher'] = $this->app->share(function ($app) {
         $publisher = new ThemePublisher($app['themes']);
         $publisher->setPackagePath($app['path.base'] . '/vendor');
         $publisher->setDispatcher($app['events']);
         return $publisher;
     });
     $this->app['command.theme.publish'] = $this->app->share(function ($app) {
         return new ThemePublishCommand($app['theme.publisher']);
     });
 }