當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。