コード例 #1
0
ファイル: Server.php プロジェクト: darrengopower/framework
 /**
  * @return $this
  */
 public function init()
 {
     $config = Arr::collapse([$this->loadIlluminateConfiguration(), $this->loadFiledConfiguration()]);
     $this->application->instance('env', 'production');
     $this->application->instance('config', new Repository($config));
     $this->application->registerConfiguredProviders();
     $this->application->singleton(HttpKernelContract::class, HttpKernel::class);
     $this->application->singleton(ConsoleKernelContract::class, ConsoleKernel::class);
     $this->application->singleton(ExceptionHandler::class, Handler::class);
     if ($this->application->isInstalled()) {
         $this->application->register(ThemeServiceProvider::class);
         $this->application->register(MenuServiceProvider::class);
         $this->application->register(CategoryServiceProvider::class);
         $this->application->register(ArticleServiceProvider::class);
         $this->application->register(HttpServiceProvider::class);
         $this->application->register(PageServiceProvider::class);
         $this->application->register(AdminServiceProvider::class);
     } else {
         $this->application->register(InstallServiceProvider::class);
     }
     return $this;
 }
コード例 #2
0
ファイル: bootstrap.php プロジェクト: darrengopower/framework
<?php

/**
 * This file is part of Notadd.
 * @author TwilRoad <*****@*****.**>
 * @copyright (c) 2015, iBenchu.org
 * @datetime 2015-10-16 21:38
 */
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Contracts\Console\Kernel as ConsoleKernelContract;
use Illuminate\Contracts\Http\Kernel as HttpKernelContract;
use Notadd\Foundation\Application;
use Notadd\Foundation\Console\Kernel as ConsoleKernel;
use Notadd\Foundation\Http\Kernel as HttpKernel;
use Notadd\Foundation\Install\Kernel as InstallKernel;
use Notadd\Foundation\Exceptions\Handler;
define('NOTADD_START', microtime(true));
require __DIR__ . '/vendor/autoload.php';
$app = new Application(realpath(__DIR__));
if ($app->isInstalled()) {
    $app->singleton(HttpKernelContract::class, HttpKernel::class);
    $app->singleton(ExceptionHandler::class, Handler::class);
} else {
    $app->singleton(HttpKernelContract::class, InstallKernel::class);
    $app->singleton(ExceptionHandler::class, Handler::class);
}
return $app;