當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Foundation\Application類代碼示例

本文整理匯總了PHP中Illuminate\Contracts\Foundation\Application的典型用法代碼示例。如果您正苦於以下問題:PHP Application類的具體用法?PHP Application怎麽用?PHP Application使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Application類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setupSeeds

 /**
  * Setup the seeds.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function setupSeeds(Application $app)
 {
     $source = realpath(__DIR__ . '/../database/seeds/');
     if ($app instanceof LaravelApplication && $app->runningInConsole()) {
         $this->publishes([$source => database_path('seeds')], 'seeds');
     }
 }
開發者ID:jnaxo,項目名稱:country-codes,代碼行數:14,代碼來源:CountryCodesServiceProvider.php

示例2: attach

 /**
  * Instanciate and execute all functions as blade extends
  *
  * @param Application $app The current application
  */
 public static function attach(Application $app)
 {
     /** @var \Illuminate\View\Compilers\BladeCompiler $blade */
     $blade = $app->make('view')->getEngineResolver()->resolve('blade')->getCompiler();
     $config = $app->make('config');
     $class = new static();
     if (!isset($class->directivesFile)) {
         $class->directivesFile = __DIR__ . '/../directives.php';
     }
     $blacklist = isset($class->blacklist) ? $class->blacklist : $config->get('blade_extensions.blacklist');
     $directives = isset($class->directives) ? $class->directives : $app->make('files')->getRequire($class->directivesFile);
     $overrides = isset($class->overrides) ? $class->overrides : $config->get('blade_extensions.overrides', []);
     foreach ($overrides as $method => $override) {
         if (!isset($directives[$method])) {
             continue;
         }
         if (isset($override['pattern'])) {
             $directives[$method]['pattern'] = $override['pattern'];
         }
         if (isset($override['replacement'])) {
             $directives[$method]['replacement'] = $override['replacement'];
         }
     }
     foreach ($directives as $name => $directive) {
         $method = 'directive' . ucfirst($name);
         if (is_array($blacklist) && in_array($name, $blacklist, true) || !method_exists($class, $method)) {
             continue;
         }
         $blade->extend(function ($value) use($class, $method, $directive, $app, $blade) {
             return $class->{$method}($value, $directive['pattern'], $directive['replacement'], $app, $blade);
         });
     }
 }
開發者ID:elbakly,項目名稱:blade-extensions,代碼行數:38,代碼來源:BladeExtenderTrait.php

示例3: let

 function let(Application $app, ContainerInterface $container)
 {
     $container->addPackage('mvalim/package')->shouldBeCalled();
     $app->make('Mvalim\\PackageUtils\\Container')->willReturn($container);
     $this->beAnInstanceOf('spec\\Mvalim\\PackageUtils\\Providers\\CorrectProviderStub');
     $this->beConstructedWith($app);
 }
開發者ID:mvalim,項目名稱:package-utils,代碼行數:7,代碼來源:CorrectPackageNameSpec.php

示例4: bootstrap

 /**
  * Bootstrap the given application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  * @return void
  */
 public function bootstrap(Application $app)
 {
     //Detect the domain
     $app->detectDomain();
     //Overrides the storage path if the domain staorge path exists
     $app->useStoragePath($app->domainStoragePath());
 }
開發者ID:gecche,項目名稱:laravel-multidomain,代碼行數:13,代碼來源:DetectDomain.php

示例5: setupMigrations

 /**
  * Setup the migrations.
  *
  * @param \Illuminate\Contracts\Foundation\Application $app
  *
  * @return void
  */
 protected function setupMigrations(Application $app)
 {
     $source = realpath(__DIR__ . '/../database/migrations/');
     if (class_exists('Illuminate\\Foundation\\Application', false) && $app->runningInConsole()) {
         $this->publishes([$source => database_path('migrations')], 'migrations');
     }
 }
開發者ID:Scaledesk,項目名稱:travally.in,代碼行數:14,代碼來源:OAuth2ServerServiceProvider.php

示例6: initMigration

 /**
  * Copy migration to resources
  *
  * @param Application $app
  */
 private function initMigration(Application $app)
 {
     if ($app instanceof \Illuminate\Foundation\Application && $app->runningInConsole()) {
         $migrationPath = realpath(__DIR__ . '/../database/migrations');
         $this->publishes([$migrationPath => database_path('migrations')]);
     }
 }
開發者ID:tuanlq11,項目名稱:auditing,代碼行數:12,代碼來源:AuditingProvider.php

示例7: bootstrap

 /**
  * Bootstrap the given application.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  *
  * @return void
  */
 public function bootstrap(Application $app)
 {
     $items = [];
     $app->instance('config', $config = new Repository($items));
     $this->loadConfigurationFiles($app, $config);
     mb_internal_encoding('UTF-8');
 }
開發者ID:diegopan,項目名稱:testbench,代碼行數:14,代碼來源:LoadConfiguration.php

示例8: __construct

 /**
  * Create a new instance of Storytelling.
  *
  * @param  \Illuminate\Contracts\Foundation\Application  $app
  */
 public function __construct($app)
 {
     $this->app = $app;
     if (method_exists($this, 'initiate')) {
         $app->call([$this, 'initiate']);
     }
 }
開發者ID:dinghua,項目名稱:crm,代碼行數:12,代碼來源:Parser.php

示例9: boot

 public function boot(Application $app)
 {
     $source = realpath(__DIR__ . '/migrations/');
     if ($app->runningInConsole()) {
         $this->publishes([$source => database_path('migrations')], 'migrations');
     }
 }
開發者ID:alfred-nutile-inc,項目名稱:route-tracking,代碼行數:7,代碼來源:RouteTrackingProvider.php

示例10: __construct

 public function __construct(Application $app)
 {
     $providers_classes = config('preview.screenshot_providers');
     foreach ($providers_classes as $class) {
         $this->providers[] = $app->make($class);
     }
 }
開發者ID:B1naryStudio,項目名稱:asciit,代碼行數:7,代碼來源:PreviewService.php

示例11: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$request->secure() && $this->app->environment() === 'production') {
         return redirect()->secure($request->getRequestUri());
     }
     return $next($request);
 }
開發者ID:mlanin,項目名稱:go,代碼行數:14,代碼來源:Secure.php

示例12: isRunningInConsole

 /**
  * Determine if the app is running in the console.
  *
  * To allow testing this will return false the environment is testing.
  *
  * @return bool
  */
 public function isRunningInConsole()
 {
     if ($this->app->environment('testing')) {
         return false;
     }
     return $this->app->runningInConsole();
 }
開發者ID:zedx,項目名稱:core,代碼行數:14,代碼來源:CacheProfile.php

示例13: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->app->isDownForMaintenance()) {
         throw new HttpException(503);
     }
     return $next($request);
 }
開發者ID:mubassirhayat,項目名稱:Laravel51-starter,代碼行數:14,代碼來源:CheckForMaintenanceMode.php

示例14: sendRequestThroughRouter

 /**
  * Send through our custom router
  *
  * @param $request
  *
  * @return Response
  */
 protected function sendRequestThroughRouter($request)
 {
     $this->app->instance('request', $request);
     return (new Pipeline($this->app))->send($request)->through($this->middleware)->then(function ($request) {
         return $this->router->dispatch($this->alexaRequest);
     });
 }
開發者ID:develpr,項目名稱:alexa-app,代碼行數:14,代碼來源:Request.php

示例15: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @return void|mixed
  */
 public function handle(Request $request, Closure $next)
 {
     if (!$this->app->isDownForMaintenance()) {
         return $next($request);
     }
     if ($request->segment(1) == 'admin') {
         return $next($request);
     }
     if (in_array($request->getClientIp(), $this->config->get('streams::maintenance.ip_whitelist', []))) {
         return $next($request);
     }
     /* @var UserInterface $user */
     $user = $this->guard->user();
     if ($user && $user->isAdmin()) {
         return $next($request);
     }
     if ($user && $this->authorizer->authorize('streams::maintenance.access')) {
         return $next($request);
     }
     if (!$user && $this->config->get('streams::maintenance.auth')) {
         /* @var Response|null $response */
         $response = $this->guard->onceBasic();
         if (!$response) {
             return $next($request);
         }
         $response->setContent(view('streams::errors.401'));
         return $response;
     }
     abort(503);
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:37,代碼來源:CheckForMaintenanceMode.php


注:本文中的Illuminate\Contracts\Foundation\Application類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。