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


PHP Config::get方法代碼示例

本文整理匯總了PHP中App\services\Config::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Config::get方法的具體用法?PHP Config::get怎麽用?PHP Config::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在App\services\Config的用法示例。


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

示例1: getProgrammes

 /**
  * Get a collection of programmes listed by letter, using a cached record if it exists
  * @param  string $letter The letter for which to query the programmes
  * @return \Illuminate\Support\Collection 
  */
 public function getProgrammes($letter)
 {
     $page = Request::get('page', 1);
     return $this->cache->remember("bbc.programmes.{$letter}.page.{$page}", \Config::get('cache.remember_time'), function () use($letter) {
         return $this->bbc_api_client->getProgrammes($letter);
     });
 }
開發者ID:harrygr,項目名稱:azlisting,代碼行數:12,代碼來源:CacheBbcApiClient.php

示例2: debug

 public function debug($request, $response, $args)
 {
     $server = ["headers" => $request->getHeaders(), "content_type" => $request->getContentType()];
     $res = ["server_info" => $server, "ip" => Http::getClientIP(), "version" => Config::get('version'), "reg_count" => Check::getIpRegCount(Http::getClientIP())];
     Logger::debug(json_encode($res));
     return $this->echoJson($response, $res);
 }
開發者ID:xyz12810,項目名稱:ss-panel,代碼行數:7,代碼來源:HomeController.php

示例3: __construct

 public function __construct()
 {
     $this->config = Config::get("mail")["mailgun"];
     $this->mg = new MailgunService($this->config["key"]);
     $this->domain = $this->config["domain"];
     $this->sender = $this->config["sender"];
 }
開發者ID:cainiaocome,項目名稱:ss-panel,代碼行數:7,代碼來源:Mailgun.php

示例4: testDebug

 public function testDebug()
 {
     $this->get('/debug');
     $this->assertEquals('200', $this->response->getStatusCode());
     $ary = json_decode($this->response->getBody(), true);
     // test version
     $this->assertEquals(Config::get('version'), $ary['version']);
 }
開發者ID:SharkIng,項目名稱:ss-panel,代碼行數:8,代碼來源:HomeTest.php

示例5: charge

 public static function charge($token, $email, $amount)
 {
     $key = Config::get('stripeKey');
     Stripe\Stripe::setApiKey($key);
     $customer = Stripe\Customer::create(array('email' => $email, 'card' => $token));
     $charge = Stripe\Charge::create(array('customer' => $customer->id, 'amount' => $amount, 'currency' => 'USD'));
     return $charge;
 }
開發者ID:SharkIng,項目名稱:ss-panel,代碼行數:8,代碼來源:StripePayment.php

示例6: checkPassword

 public static function checkPassword($hashedPassword, $password)
 {
     $method = Config::get('pwdMethod');
     if ($hashedPassword == self::passwordHash($password)) {
         return true;
     }
     return false;
 }
開發者ID:ss-panel,項目名稱:ss-panel,代碼行數:8,代碼來源:Hash.php

示例7: sendEmailConfirmationTo

 /**
  * Deliver the email confirmation.
  *
  * @param  User $user
  * @return void
  */
 public function sendEmailConfirmationTo(User $user)
 {
     $this->to = $user->email;
     $this->view = 'emails.confirm';
     $this->from = \Config::get('mail.from.address');
     $this->name = \Config::get('mail.from.name');
     $this->data = compact('user');
     $this->deliver('🚗 애.카.프. 딜러회원 가입을 완료해주세요.');
 }
開發者ID:jinseokoh,項目名稱:ask,代碼行數:15,代碼來源:AppMailer.php

示例8: isAbleToCheckin

 public function isAbleToCheckin()
 {
     $last = $this->attributes['last_check_in_time'];
     $hour = Config::get('checkinTime');
     if ($last + $hour * 3600 < time()) {
         return true;
     }
     return false;
 }
開發者ID:ss-panel,項目名稱:ss-panel,代碼行數:9,代碼來源:User.php

示例9: createTokenStorage

 public static function createTokenStorage()
 {
     switch (Config::get('tokenDriver')) {
         case 'db':
             return new DB();
         case 'dynamodb':
             return new Dynamodb();
         default:
             return new DB();
     }
 }
開發者ID:SharkIng,項目名稱:ss-panel,代碼行數:11,代碼來源:Factory.php

示例10: newSessionCache

 /**
  * @return Cache
  */
 public static function newSessionCache()
 {
     switch (Config::get('session')) {
         case 'redis':
             return self::newRedisCache();
         case 'file':
             return self::newFileCache(Config::getStoragePath('/framework/sessions'));
         default:
             return self::newFileCache();
     }
 }
開發者ID:SharkIng,項目名稱:ss-panel,代碼行數:14,代碼來源:Factory.php

示例11: post

 /**
  * @param string $message
  * @param string $type
  * @param array $attachment
  */
 public function post($message, $type, $attachment = [])
 {
     $type = \Config::get('slack.types.' . strtolower($type), \Config::get('slack.default', []));
     $webHookUrl = \Config::get('slack.webHookUrl');
     $client = new Client($webHookUrl, ['username' => array_get($type, 'username', 'FamarryBot'), 'channel' => array_get($type, 'channel', '#random'), 'link_names' => true, 'icon' => array_get($type, 'icon', ':smile:')]);
     $messageObj = $client->createMessage();
     if (!empty($attachment)) {
         $attachment = new Attachment(['fallback' => array_get($attachment, 'fallback', ''), 'text' => array_get($attachment, 'text', ''), 'pretext' => array_get($attachment, 'pretext', ''), 'color' => array_get($attachment, 'color', 'good'), 'fields' => array_get($attachment, 'fields', [])]);
         $messageObj->attach($attachment);
     }
     $messageObj->setText($message)->send();
 }
開發者ID:ykusakabe,項目名稱:laravel-51-boilerplate,代碼行數:17,代碼來源:SlackService.php

示例12: registerJob

 public function registerJob($jobId, $jobInfo)
 {
     $queueData = ['key' => \Config::get('async.key'), 'jobs' => [['id' => $jobId, 'data' => $jobInfo]]];
     if (\Config::get('async.enable', false) == true) {
         $auth = ["key" => \Config::get('aws.accounts.key'), "secret" => \Config::get('aws.accounts.secret'), "region" => \Config::get('aws.accounts.region')];
         $sqs = new SqsClient($auth);
         $sqs->{$sqs}->sendMessage(['QueueUrl' => \Config::get('async.worker.queue'), 'MessageBody' => json_encode($queueData)]);
         // Log::info('Add Queue:' . json_encode($queueData));
     } else {
         $this->executeJob($queueData);
     }
 }
開發者ID:ykusakabe,項目名稱:laravel-51-boilerplate,代碼行數:12,代碼來源:AsyncService.php

示例13: setStatusName

 private function setStatusName($todos)
 {
     foreach ($todos as $todo) {
         if ($todo->deleted_at) {
             $todo->status_name = 'DELETED';
         } elseif ($todo->status == \Config::get('app.status.todo.incomplete')) {
             $todo->status_name = 'INCOMPLETE';
         } elseif ($todo->status == \Config::get('app.status.todo.completed')) {
             $todo->status_name = 'COMPLETED';
         }
     }
     return $todos;
 }
開發者ID:kondo-takuto-mulodo,項目名稱:laravel_unittest,代碼行數:13,代碼來源:TodoService.php

示例14: getDriver

 public static function getDriver()
 {
     $method = Config::get('authDriver');
     switch ($method) {
         case 'cookie':
             return new Cookie();
             break;
         case 'redis':
             return new Redis();
             break;
     }
     return new Redis();
 }
開發者ID:Elenw,項目名稱:ss-panel,代碼行數:13,代碼來源:Auth.php

示例15: createAuth

 public static function createAuth()
 {
     $method = Config::get('authDriver');
     switch ($method) {
         case 'cookie':
             return new Cookie();
         case 'redis':
             return new Redis();
         case 'jwt':
             return new JwtToken();
     }
     return new Redis();
 }
開發者ID:wswing,項目名稱:ss-panel,代碼行數:13,代碼來源:Factory.php


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