本文整理汇总了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);
});
}
示例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);
}
示例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"];
}
示例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']);
}
示例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;
}
示例6: checkPassword
public static function checkPassword($hashedPassword, $password)
{
$method = Config::get('pwdMethod');
if ($hashedPassword == self::passwordHash($password)) {
return true;
}
return false;
}
示例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('🚗 애.카.프. 딜러회원 가입을 완료해주세요.');
}
示例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;
}
示例9: createTokenStorage
public static function createTokenStorage()
{
switch (Config::get('tokenDriver')) {
case 'db':
return new DB();
case 'dynamodb':
return new Dynamodb();
default:
return new DB();
}
}
示例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();
}
}
示例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();
}
示例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);
}
}
示例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;
}
示例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();
}
示例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();
}