当前位置: 首页>>代码示例>>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;未经允许,请勿转载。