static function startUp(KernelInterface $kernel, ModuleInfo $moduleInfo)
 {
     $kernel->onConfigure(function (MatisseSettings $matisseSettings, ViewEngineSettings $viewEngineSettings) use($moduleInfo) {
         $matisseSettings->registerComponents(['SideBarMenu' => SideBarMenu::class])->registerControllersNamespace($moduleInfo, \Selenia\Platform\Components::class, 'platform');
         $viewEngineSettings->registerViews($moduleInfo);
     });
 }
 static function startUp(KernelInterface $kernel, ModuleInfo $moduleInfo)
 {
     $kernel->onConfigure(function (ApplicationRouterInterface $router, NavigationSettings $navigationSettings, ViewEngineSettings $viewEngineSettings, MatisseSettings $matisseSettings) use($moduleInfo) {
         $viewEngineSettings->registerViews($moduleInfo);
         $matisseSettings->registerMacros($moduleInfo);
         $router->add(Routes::class);
         $navigationSettings->registerNavigation(Navigation::class);
     });
 }
 static function startUp(KernelInterface $kernel, ModuleInfo $moduleInfo)
 {
     $kernel->onRegisterServices(function (InjectorInterface $injector) {
         $injector->alias(ErrorRendererInterface::class, ErrorRenderer::class)->share(ErrorHandlingSettings::class);
     });
     if ($kernel->devEnv()) {
         $kernel->onConfigure(function (ApplicationMiddlewareInterface $applicationMiddleware) {
             $applicationMiddleware->add(EditorLauncherMiddleware::class, null, 'router');
         });
     }
 }
Пример #4
0
 static function startUp(KernelInterface $kernel, ModuleInfo $moduleInfo)
 {
     $kernel->onConfigure(function (KernelSettings $app, ApplicationRouterInterface $router, NavigationSettings $navigationSettings, ViewEngineSettings $viewEngineSettings) use($moduleInfo) {
         $app->name = 'yourapp';
         // session cookie name
         $app->appName = 'Your App';
         // default page title; also displayed on title bar (optional)
         $app->title = '@ - Your App';
         // @ = page title
         $viewEngineSettings->registerViews($moduleInfo);
         $router->add(Routes::class);
         $navigationSettings->registerNavigation(Navigation::class);
     });
 }
 static function startUp(KernelInterface $kernel, ModuleInfo $moduleInfo)
 {
     $kernel->onRegisterServices(function (InjectorInterface $injector) {
         $injector->share(DatabaseAPI::class)->prepare(DatabaseAPI::class, function (DatabaseAPI $db) {
             $db->manager->setAsGlobal();
             $db->manager->setEventDispatcher(new Dispatcher($db->manager->getContainer()));
             $db->manager->bootEloquent();
             Model::setConnectionResolver($db);
         })->alias(ModelControllerInterface::class, ModelController::class)->share(ModelController::class)->share(MigrationsSettings::class)->alias(MigrationsInterface::class, Migrations::class);
     });
     if ($kernel->getProfile() instanceof ConsoleProfile) {
         $kernel->onConfigure(function (ConsoleSettings $consoleSettings) {
             $consoleSettings->registerTasksFromClass(MigrationCommands::class);
         });
     }
 }
 static function startUp(KernelInterface $kernel, ModuleInfo $moduleInfo)
 {
     $kernel->onConfigure(function (KernelSettings $app, ApplicationRouterInterface $router, NavigationSettings $navigationSettings, ViewEngineSettings $viewEngineSettings, MatisseSettings $matisseSettings, LocalizationSettings $localizationSettings) use($moduleInfo) {
         $app->name = 'demoapp';
         // session cookie name
         $app->appName = '$DEMO_APP';
         // default page title; also displayed on title bar (optional)
         $app->title = '@ - $DEMO_APP';
         // @ = page title
         $localizationSettings->registerTranslations($moduleInfo);
         $viewEngineSettings->registerViews($moduleInfo);
         $matisseSettings->registerMacros($moduleInfo);
         $router->add(Routes::class);
         $navigationSettings->registerNavigation(Navigation::class);
     });
 }
 static function startUp(KernelInterface $kernel, ModuleInfo $moduleInfo)
 {
     $kernel->onConfigure(function (MatisseSettings $matisseSettings, ModelControllerInterface $modelController, InjectorInterface $injector, ContentServerSettings $contentServerSettings, AssetsService $assetsService) use($moduleInfo) {
         $matisseSettings->registerMacros($moduleInfo)->registerComponents(['Button' => C\Button::class, 'Checkbox' => C\Checkbox::class, 'DataGrid' => C\DataGrid::class, 'Dropzone' => C\Dropzone::class, 'Field' => C\Field::class, 'FileUpload' => C\FileUpload::class, 'HtmlEditor' => C\HtmlEditor::class, 'Image' => C\Image::class, 'ImageField' => C\ImageField::class, 'Input' => C\Input::class, 'Label' => C\Label::class, 'Link' => C\Link::class, 'MainMenu' => C\MainMenu::class, 'NavigationPath' => C\NavigationPath::class, 'Paginator' => C\Paginator::class, 'RadioButton' => C\RadioButton::class, 'Select' => C\Select::class, 'Switch' => C\Switch_::class, 'Tab' => C\Tab::class, 'TabPage' => C\TabPage::class, 'Tabs' => C\Tabs::class]);
         $assetsService->registerAssets($moduleInfo->name, ['dist/components.css']);
         $modelController->registerExtension($injector->makeFactory(ImageFieldHandler::class));
         File::deleting(function (File $model) use($contentServerSettings, $injector) {
             if (exists($model->path)) {
                 $path = "{$contentServerSettings->fileArchivePath()}/{$model->path}";
                 if (file_exists($path)) {
                     unlink($path);
                 }
                 $glideServer = $injector->make(Server::class);
                 $glideServer->deleteCache($model->path);
             }
         });
     });
 }
 static function startUp(KernelInterface $kernel, ModuleInfo $moduleInfo)
 {
     $kernel->onConfigure(function (LoggerInterface $logger, $webConsole) {
         if ($webConsole) {
             DebugConsole::registerPanel('request', new PSR7RequestLogger('Request', 'fa fa-paper-plane'));
             DebugConsole::registerPanel('response', new PSR7ResponseLogger('Response', 'fa fa-file'));
             DebugConsole::registerPanel('routes', new ConsoleLogger('Routing', 'fa fa-location-arrow'));
             DebugConsole::registerPanel('navigation', new ConsoleLogger('Navigation', 'fa fa-compass big'));
             DebugConsole::registerPanel('config', new ConsoleLogger('Configuration', 'fa fa-cogs'));
             DebugConsole::registerPanel('session', new ConsoleLogger('Session', 'fa fa-user'));
             DebugConsole::registerPanel('database', new ConsoleLogger('Database', 'fa fa-database'));
             DebugConsole::registerLogger('trace', new ConsoleLogger('Trace', 'fa fa-clock-o big'));
             //    DebugConsole::registerPanel ('exceptions', new ConsoleLogger ('Exceptions', 'fa fa-bug'));
             // Writing to the logger also writes to the Inspector panel.
             if ($logger instanceof Logger) {
                 $logger->pushHandler(new WebConsoleMonologHandler(env('DEBUG_LEVEL') ?: Logger::DEBUG));
             }
         }
     });
 }