当前位置: 首页>>代码示例>>PHP>>正文


PHP App::environment方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\App::environment方法的典型用法代码示例。如果您正苦于以下问题:PHP App::environment方法的具体用法?PHP App::environment怎么用?PHP App::environment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\App的用法示例。


在下文中一共展示了App::environment方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ('testing' == App::environment()) {
         return $next($request);
     }
     return parent::handle($request, $next);
 }
开发者ID:yoganandgopalan,项目名称:InventoryCarShowroom,代码行数:14,代码来源:VerifyCsrfToken.php

示例2: getLogin

 /**
  * @param Request $request
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function getLogin(Request $request)
 {
     if (App::environment('demo')) {
         $request->session()->flashInput(['email' => 'admin@societycms.com', 'password' => 'secret']);
     }
     return view('user::public.login');
 }
开发者ID:SocietyCMS,项目名称:User,代码行数:12,代码来源:AuthController.php

示例3: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     Model::unguard();
     DB::statement('SET FOREIGN_KEY_CHECKS=0');
     if (!App::environment('production')) {
         $this->call('UsersTableSeeder');
         $this->call('ProfilesTableSeeder');
     }
     $this->call('RolesTableSeeder');
     $this->call('DestinationsTableSeeder');
     $this->call('LocationsTableSeeder');
     $this->call('MissionTypesTableSeeder');
     $this->call('VehiclesTableSeeder');
     $this->call('StatisticsTableSeeder');
     $this->call('PartsTableSeeder');
     $this->call('MissionsTableSeeder');
     $this->call('PartFlightsTableSeeder');
     $this->call('TagsTableSeeder');
     $this->call('NotificationTypesTableSeeder');
     $this->call('NotificationsTableSeeder');
     $this->call('AstronautsTableSeeder');
     $this->call('SpacecraftTableSeeder');
     $this->call('SpacecraftFlightsTableSeeder');
     $this->call('PayloadsTableSeeder');
     $this->call('TelemetryTableSeeder');
     $this->call('PrelaunchEventsTableSeeder');
     DB::statement('SET FOREIGN_KEY_CHECKS=1');
 }
开发者ID:RoryStolzenberg,项目名称:spacexstats,代码行数:33,代码来源:DatabaseSeeder.php

示例4: upload

 public function upload(FormUploadRequest $request)
 {
     $attributes = $request->all();
     // fetch the file
     $file = $request->file('file');
     if (!$file->isValid()) {
         throw new Exception('File is not valid');
     }
     if (App::environment() == 'testing') {
         $destinationDir = public_path() . '/testdata/forms';
     } else {
         $destinationDir = public_path() . '/data/forms';
     }
     $slug = str_slug($attributes['name']);
     $destinationFile = $attributes['year'] . '-' . $slug . '.' . $file->getClientOriginalExtension();
     $file->move($destinationDir, $destinationFile);
     $form = new Form();
     $form->year = $attributes['year'];
     $form->name = str_replace('-', '_', str_slug($attributes['name']));
     $form->slug = $attributes['year'] . '-' . $slug;
     $form->location = str_replace(public_path(), '', $destinationDir . '/' . $destinationFile);
     $form->extension = $file->getClientOriginalExtension();
     $form->size = filesize($destinationDir . '/' . $destinationFile);
     $form->md5 = md5($destinationDir . '/' . $destinationFile);
     $form->save();
     $resource = new Item($form, new FormTransformer(), 'forms');
     return response()->json($this->fractal()->createData($resource)->toArray(), Response::HTTP_CREATED);
 }
开发者ID:cincyultimate,项目名称:cupa-api-poc,代码行数:28,代码来源:FormController.php

示例5: down

 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     if (\Illuminate\Support\Facades\App::environment('local')) {
         Schema::drop('settings');
     } else {
         throw new Exception('Migrating down is prohibited.');
     }
 }
开发者ID:jardayn,项目名称:portfolio,代码行数:13,代码来源:2015_10_27_100322_create_settings_table.php

示例6: postPullRequest

 /**
  * Run a pull on the QA git repo if merged into master
  *
  * @return \Illuminate\Http\Response
  */
 public function postPullRequest(Request $Request)
 {
     $request = $Request->all();
     if (App::environment() === 'qa' && $request['action'] === 'closed' && $request['pull_request']['merged'] === true && $request['pull_request']['base']['ref'] === 'qa') {
         exec('cd /var/www/qa.hometeachme.org/ && git pull');
     }
     return new Response('pull request received!', 200);
 }
开发者ID:joshdavis11,项目名称:hometeachme,代码行数:13,代码来源:PullRequestController.php

示例7: __construct

 public function __construct()
 {
     if (App::environment() == 'testing') {
         $this->destinationDir = public_path() . '/testdata/minutes';
     } else {
         $this->destinationDir = public_path() . '/data/minutes';
     }
 }
开发者ID:cincyultimate,项目名称:cupa-api-poc,代码行数:8,代码来源:MinuteController.php

示例8: subscribe

 public function subscribe($events)
 {
     if (empty(Slack::getEndpoint()) || App::environment('local')) {
         return;
     }
     $events->listen('new-signup', [$this, 'onNewSignup']);
     $events->listen('new-conference', [$this, 'onNewConference']);
 }
开发者ID:jwalton512,项目名称:symposium,代码行数:8,代码来源:SlackSubscriber.php

示例9: run

 public function run()
 {
     if (App::environment() == 'local') {
         //Delete all records from the users table
         DB::table('users')->delete();
         //Create a demo user
         User::create(array('email' => 'user@user.be', 'password' => Hash::make('user'), 'firstname' => 'User', 'lastname' => 'Demo', 'status' => 1));
     }
 }
开发者ID:gaurangsudra,项目名称:laravel51-multiauth-socialite,代码行数:9,代码来源:DatabaseSeeder.php

示例10: sendAdminEmail

 public static function sendAdminEmail($data)
 {
     Mail::send([], $data, function ($message) use($data) {
         $message->to(Config::get('mail.admin_email'));
         $message->subject(App::environment() . ': ' . $data['subject']);
         $message->setBody(App::environment() . ': ' . $data['text']);
     });
     return true;
 }
开发者ID:denpamusic,项目名称:EzBitcoin-Api-Wallet,代码行数:9,代码来源:MailHelper.php

示例11: sendEmailPlain

 public static function sendEmailPlain($data)
 {
     Mail::send([], $data, function ($message) use($data) {
         $message->to($data['email']);
         $message->subject(App::environment() . ': ' . $data['subject']);
         $message->setBody(App::environment() . ': ' . $data['text']);
     });
     return true;
 }
开发者ID:afrikanhut,项目名称:EzBitcoin-Api-Wallet,代码行数:9,代码来源:MailHelper.php

示例12: handle

 public function handle()
 {
     if (App::environment() == 'production') {
         $this->error("Production? Not sure if I can run this on production");
         exit;
     }
     $this->app_folder = base_path();
     $this->repo_name = $this->argument('repo_name');
     $this->runScripts();
 }
开发者ID:alfred-nutile-inc,项目名称:setup,代码行数:10,代码来源:SetupCommand.php

示例13: store

 /**
  * @param TelegramMessageRequest $request
  *
  * @return JsonResponse
  */
 public function store(TelegramMessageRequest $request)
 {
     $content = ['chat_id' => StaffTelegramGroup::id(), 'text' => sprintf('(%s) %s', App::environment(), $request->text())];
     try {
         $message = $this->telegram->sendMessage($content);
         $this->webUi->successMessage("Sent message `{$message->getMessageId()}` to staff");
     } catch (\Exception $e) {
         $this->webUi->errorMessage(sprintf('Failed to send message to staff: %s (%s)', $e->getMessage(), json_encode($content)));
     }
     return $this->webUi->redirect('telegram.index');
 }
开发者ID:hughgrigg,项目名称:ching-shop,代码行数:16,代码来源:TelegramController.php

示例14: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     //        && !App::environment('local')
     //        dd($request->getRequestUri());
     if ($request->secure() && !App::environment('local')) {
         //            return redirect('https://www.colorme.vn');
         //            return redirect()->secure($request->getRequestUri());
         return redirect($request->getRequestUri());
     }
     return $next($request);
 }
开发者ID:Kaelcao,项目名称:colormev2,代码行数:18,代码来源:HttpsProtocol.php

示例15: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     if (\Illuminate\Support\Facades\App::environment() === 'local') {
         Model::unguard();
         $this->cleanDatabase();
         $this->call('UserTableSeeder');
         $this->call('RoleTableSeeder');
         $this->call('PageTableSeeder');
         Model::reguard();
     }
 }
开发者ID:uusa35,项目名称:graduationProject,代码行数:16,代码来源:DatabaseSeeder.php


注:本文中的Illuminate\Support\Facades\App::environment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。