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


PHP services\Config类代码示例

本文整理汇总了PHP中App\services\Config的典型用法代码示例。如果您正苦于以下问题:PHP Config类的具体用法?PHP Config怎么用?PHP Config使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: bootDb

 public static function bootDb()
 {
     // Init Eloquent ORM Connection
     $capsule = new Capsule();
     $capsule->addConnection(Config::getDbConfig());
     $capsule->bootEloquent();
 }
开发者ID:NothingToDoCN,项目名称:ss-panel,代码行数:7,代码来源:Boot.php

示例2: testHandleRegister

 public function testHandleRegister()
 {
     $code = $this->addCode();
     // test wrong code
     $this->post('/auth/register', []);
     $this->assertEquals('200', $this->response->getStatusCode());
     $this->checkErrorCode(AuthController::WrongCode);
     // test illegal email
     $this->post('/auth/register', ["code" => $code]);
     $this->assertEquals('200', $this->response->getStatusCode());
     $this->checkErrorCode(AuthController::IllegalEmail);
     // test password to short
     $shortPwd = '123';
     $this->post('/auth/register', ["code" => $code, "email" => $this->email, "passwd" => $shortPwd]);
     $this->assertEquals('200', $this->response->getStatusCode());
     $this->checkErrorCode(AuthController::PasswordTooShort);
     // test password not equal
     $this->post('/auth/register', ["code" => $code, "email" => $this->email, "passwd" => $this->password, "repasswd" => $shortPwd]);
     $this->assertEquals('200', $this->response->getStatusCode());
     $this->checkErrorCode(AuthController::PasswordNotEqual);
     // test email used
     $this->post('/auth/register', ["code" => $code, "email" => $this->getExistEmail(), "passwd" => $this->password, "repasswd" => $this->password]);
     $this->assertEquals('200', $this->response->getStatusCode());
     $this->checkErrorCode(AuthController::EmailUsed);
     //  illegal register
     Config::set('emailVerifyEnabled', false);
     $this->post('/auth/register', ["code" => $code, "email" => $this->email, "passwd" => $this->password, "repasswd" => $this->password, "name" => "name"]);
     $this->assertEquals('200', $this->response->getStatusCode());
 }
开发者ID:SharkIng,项目名称:ss-panel,代码行数:29,代码来源:AuthTest.php

示例3: 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

示例4: 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

示例5: __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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: testHash

 public function testHash()
 {
     Config::set('pwdMethod', 'md5');
     $this->hashTest();
     Config::set('pwdMethod', 'sha256');
     $this->hashTest();
     Config::set('pwdMethod', 'default');
     $this->hashTest();
 }
开发者ID:SharkIng,项目名称:ss-panel,代码行数:9,代码来源:HashTest.php

示例12: 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

示例13: 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

示例14: 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

示例15: 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


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