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


PHP Facades\Config類代碼示例

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


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

示例1: testGetOwner

 public function testGetOwner()
 {
     Config::shouldReceive('get')->once()->with('auth.model')->andReturn('TestUser');
     $stub = m::mock('TestUserTeamTraitStub[hasOne]');
     $stub->shouldReceive('hasOne')->once()->with('User', 'user_id', 'owner_id')->andReturn([]);
     $this->assertEquals([], $stub->owner());
 }
開發者ID:nilsenj,項目名稱:itway,代碼行數:7,代碼來源:TeamworkTeamTraitTest.php

示例2: index

 /**
  * List of users
  *
  * @return View
  */
 public function index()
 {
     $dynamicItems = $this->userRepo->getAllPaginated(50, true);
     $operationColumn = 'admin.pages.user.partials._operation';
     $columns = Config::get('dynamic_data/datatables.users');
     return $this->view($this->getView('admin.pages.user.index', 'admin.pages.common.index'), compact('dynamicItems', 'operationColumn', 'columns'));
 }
開發者ID:Ajaxman,項目名稱:SaleBoss,代碼行數:12,代碼來源:UserController.php

示例3:

 function __construct()
 {
     $this->default = Config::get("nlp.default");
     $this->api_key = Config::get("nlp.connections.{$this->default}.API_KEY");
     $this->result_type = \Config::get("nlp.result");
     $this->cache_type = \Config::get("nlp.cache");
 }
開發者ID:mozzos,項目名稱:nlptool,代碼行數:7,代碼來源:NLPAbstract.php

示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $user = Auth::user();
     $pusher = new Pusher(Config::get('services.pusher.key'), Config::get('services.pusher.secret'), Config::get('services.pusher.id'));
     $pusher->trigger('my-channel', 'my-event', array('message' => $user->name . ': ' . Input::get('msg'), 'user_id' => $user->id));
     return 'done';
 }
開發者ID:andy-pei,項目名稱:chatApp,代碼行數:13,代碼來源:ChatController.php

示例5: __construct

 public function __construct()
 {
     // setup PayPal api context
     $paypal_conf = Config::get('paypal');
     $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));
     $this->_api_context->setConfig($paypal_conf['settings']);
 }
開發者ID:alfoalfr,項目名稱:laravel-dev-env,代碼行數:7,代碼來源:PaymentPaypal.php

示例6: login

 /**
  * 用戶通過郵箱和密碼進行登錄操作
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function login(Request $request)
 {
     //獲取當前訪問的全部的地址
     $request_url = str_replace("http://" . Config::get('app.url'), "", $request->url());
     //驗證參數
     $validator = Validator::make($request->all(), ['email' => 'required|email', 'password' => 'required']);
     //驗證參數完整性
     if ($validator->fails()) {
         // var_dump($validator);
         $error = $validator->errors()->all();
         //寫入日誌
         Log::error(['error' => $error, 'request' => $request->all(), 'header' => $request->headers, 'client_ip' => $request->getClientIp()]);
         //返回錯誤信息
         return Error::returnError($request_url, 1001);
     }
     $email = $request->get('email');
     $password = $request->get('password');
     //檢查有沒有
     $user_model = User::checkUserLogin($email, $password);
     if ($user_model == false) {
         return Error::returnError($request_url, 2001);
     }
     //更新token
     $token = User::updateToken($user_model);
     //返回對應的結果
     $json_arr = ['request' => $request_url, 'ret' => User::getUserInfo($user_model->id), 'token' => $token];
     return Common::returnResult($json_arr);
 }
開發者ID:diandianxiyu,項目名稱:LaravelApi,代碼行數:34,代碼來源:UserController.php

示例7: setUp

 public function setUp()
 {
     // set up config
     Config::shouldReceive('get')->zeroOrMoreTimes()->with("datatable::engine")->andReturn(array('exactWordSearch' => false));
     $this->collection = new Collection();
     $this->engine = new CollectionEngine($this->collection);
 }
開發者ID:Kangaroos,項目名稱:oneshike,代碼行數:7,代碼來源:BaseEngineTest.php

示例8: bootSilverstripe

    protected function bootSilverstripe($url = null)
    {
        $flush = $this->option('flush');
        // to allow the Silverstripe command line to know what the server URL should be ...
        // sadly, setting a global $_FILE_TO_URL_MAPPING variable is not enough because Silverstripe's Core.php (or
        // Constants.php in newer versions) doesn't declare it as global - it assumes it's declared in the
        // _ss_environment.php file which is _included_ not _required_. Boo.
        //        global $_FILE_TO_URL_MAPPING;
        //        $_FILE_TO_URL_MAPPING[base_path()] = Config::get('app.url');
        $base = base_path();
        $envPath = $base . '/_ss_environment.php';
        if (!file_exists($envPath)) {
            $appUrl = Config::get('app.url');
            file_put_contents($envPath, <<<EOT
<?php
global \$_FILE_TO_URL_MAPPING;
\$_FILE_TO_URL_MAPPING['{$base}'] = '{$appUrl}';
EOT
);
            App::shutdown(function ($app) use($envPath) {
                unlink($envPath);
            });
        }
        // taken from silverstripe's framework/cli-script.php
        if ($flush) {
            $_REQUEST['flush'] = $flush === true ? 1 : $flush;
            $_GET['flush'] = $flush === true ? 1 : $flush;
        }
        if ($url) {
            $_REQUEST['url'] = $url;
            $_GET['url'] = $url;
        }
        Silverstripe::start();
    }
開發者ID:helpfulrobot,項目名稱:themonkeys-laravel-silverstripe,代碼行數:34,代碼來源:SilverstripeCommand.php

示例9: handle

 public function handle($payload)
 {
     $this->folder = $payload['folder'];
     $this->cleanUp();
     if (isset($payload['bucket'])) {
         Config::set('S3_BUCKET', $payload['bucket']);
     }
     if (isset($payload['region'])) {
         Config::set('S3_REGION', $payload['region']);
     }
     if (isset($payload['secret'])) {
         Config::set('S3_SECRET', $payload['secret']);
     }
     if (isset($payload['key'])) {
         Config::set('S3_KEY', $payload['key']);
     }
     if (isset($payload['destination'])) {
         $this->thumbnail_destination = $payload['destination'];
     } else {
         $this->thumbnail_destination = base_path("storage");
     }
     if (!Storage::exists($this->thumbnail_destination)) {
         Storage::makeDirectory($this->thumbnail_destination, 0755, true);
     }
     $files = Storage::disk('s3')->allFiles($this->folder);
     Log::info(print_r($files, 1));
     $this->getAndMake($files);
     $this->uploadFilesBacktoS3();
     $this->cleanUp();
 }
開發者ID:nagyistoce,項目名稱:thumbnail-maker,代碼行數:30,代碼來源:ThumbMakerService.php

示例10: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('mmanos/laravel-casset');
     if ($route = Config::get('laravel-casset::route')) {
         Route::get(trim($route, '/') . '/{type}', 'Mmanos\\Casset\\CassetController@getIndex');
     }
 }
開發者ID:mmanos,項目名稱:laravel-casset,代碼行數:12,代碼來源:CassetServiceProvider.php

示例11: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $days_to_wait = Config::get('store.days_to_remind');
     //\DB::enableQueryLog();
     $this->info("Checks If there are orders to be rated ({$days_to_wait} Days Old)");
     //Checks all closed orders that has not been rated nor mail has been sent and where updated 5 days ago
     //and the mails has not been sent yet
     $orders = Order::where('rate', null)->where('status', 'closed')->where('rate_mail_sent', false)->where('updated_at', '<', Carbon::now()->subDays($days_to_wait))->get();
     //$this->info(print_r(\DB::getQueryLog()));
     $this->info("Orders That need mail: " . $orders->count());
     foreach ($orders as $order) {
         $this->info("Order: " . $order->id . ' Needs to be rated, and mail has not been sent');
         $buyer = User::find($order->user_id);
         if ($buyer) {
             $email = $buyer->email;
             $mail_subject = trans('email.cron_emails.remind_rate_order_subject');
             $data = ['email_message' => $mail_subject, 'email' => $email, 'subject' => $mail_subject, 'order_id' => $order->id];
             Mail::queue('emails.cron.rate_order', $data, function ($message) use($data) {
                 $message->to($data['email'])->subject($data['subject']);
             });
             $order->rate_mail_sent = true;
             $order->save();
         }
     }
 }
開發者ID:masterpowers,項目名稱:antVel,代碼行數:30,代碼來源:SendRateMails.php

示例12: __construct

 /**
  * Route53 constructor.
  *
  * @param null $access_key
  * @param null $secret_key
  */
 public function __construct($access_key = null, $secret_key = null)
 {
     $this->access_key = Config::get('aws_sdk.access_key', $access_key);
     $this->secret_key = Config::get('aws_sdk.secret_key', $secret_key);
     $this->host = Config::get('aws_sdk.route53_host', 'route53.amazonaws.com');
     $this->api_version = self::API_VERSION;
 }
開發者ID:lu1ssuarez,項目名稱:aws-sdk-wrapper,代碼行數:13,代碼來源:Route53.php

示例13: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     $this->app['router']->before(function ($request) {
         // First clear out all "old" visitors
         Visitor::clear();
         $page = Request::path();
         $ignore = Config::get('visitor-log::ignore');
         if (is_array($ignore) && in_array($page, $ignore)) {
             //We ignore this site
             return;
         }
         $visitor = Visitor::getCurrent();
         if (!$visitor) {
             //We need to add a new user
             $visitor = new Visitor();
             $visitor->ip = Request::getClientIp();
             $visitor->useragent = Request::server('HTTP_USER_AGENT');
             $visitor->sid = str_random(25);
         }
         $user = null;
         $usermodel = strtolower(Config::get('visitor-log::usermodel'));
         if (($usermodel == "auth" || $usermodel == "laravel") && Auth::check()) {
             $user = Auth::user()->id;
         }
         if ($usermodel == "sentry" && class_exists('Cartalyst\\Sentry\\SentryServiceProvider') && Sentry::check()) {
             $user = Sentry::getUser()->id;
         }
         //Save/Update the rest
         $visitor->user = $user;
         $visitor->page = $page;
         $visitor->save();
     });
 }
開發者ID:uniacid,項目名稱:visitor-log,代碼行數:38,代碼來源:VisitorLogServiceProvider.php

示例14: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (Config::get("customer_portal.ticketing_enabled") !== true) {
         return redirect()->back()->withErrors(trans("errors.sectionDisabled"));
     }
     return $next($request);
 }
開發者ID:sonarsoftware,項目名稱:customer_portal,代碼行數:14,代碼來源:TicketMiddleware.php

示例15: getNotificationRegistrationUsersEmail

 /**
  * Obtain the user that needs to be notificated on registration
  *
  * @return array
  */
 public function getNotificationRegistrationUsersEmail()
 {
     $group_name = Config::get('laravel-authentication-acl::permissions.profile_notification_group');
     $user_r = App::make('user_repository');
     $users = $user_r->findFromGroupName($group_name)->lists('email');
     return $users;
 }
開發者ID:nirvanpagooah,項目名稱:laravel-authentication-acl,代碼行數:12,代碼來源:SentryAuthenticationHelper.php


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