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


PHP Config::get方法代碼示例

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


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

示例1: __construct

 public function __construct($db_name, $db_user = 'root', $db_pass = 'root', $db_host = 'localhost')
 {
     $config = new Config();
     if ($config != null) {
         $this->db_name = $config->get("db_name");
         $this->db_user = $config->get("db_user");
         $this->db_pass = $config->get("db_pass");
         $this->db_host = $config->get("db_host");
     }
 }
開發者ID:stormtrooper42,項目名稱:stirl,代碼行數:10,代碼來源:Database.php

示例2: getRole

 public static function getRole($role_id)
 {
     //TODO let's not call the DB here.
     //return self::find($role_id);
     $roles = (array) \Config::get('mycustomvars.roles');
     return array_search($role_id, $roles);
 }
開發者ID:jtoshmat,項目名稱:laravel,代碼行數:7,代碼來源:Role.php

示例3: __construct

 public function __construct()
 {
     $adapter = Config::get('database.engine');
     $this->created_at = date('Y-m-d H:i:s');
     $this->update = (object) array();
     $this->setAdapter(DatabaseAdapterFactory::create($adapter));
 }
開發者ID:adrielov,項目名稱:Chalenge-SOFTBOX,代碼行數:7,代碼來源:Model.php

示例4: createFromApi

 public static function createFromApi($placeId, $apiData)
 {
     $photo = self::create(['place_id' => $placeId, 'photo_reference' => $apiData->photo_reference, 'width' => $apiData->width, 'height' => $apiData->height]);
     $response = \App\Api\Place::getPhoto($apiData->photo_reference);
     file_put_contents(\Config::get('place.photo_path') . $photo->id . '.jpg', $response->getResultPhoto());
     unset($response);
 }
開發者ID:majchrosoft,項目名稱:bars-in-cracow,代碼行數:7,代碼來源:Photo.php

示例5: getStatsAction

 public function getStatsAction()
 {
     $config = Config::get("kayako");
     $db = new \PDO("mysql:dbname=" . $config["database"] . ";host=" . $config["host"], $config["username"], $config["password"]);
     $sql = "\n                SELECT ticketstatusid, ticketstatustitle, ownerstaffid, ownerstaffname, count(*) as cnt FROM `swtickets`\n                WHERE departmentid in (3,4)\n                GROUP BY ticketstatusid, ownerstaffid, ownerstaffname\n              ";
     $stats = array("status" => array("total" => 0), "user" => array("total" => 0));
     foreach ($db->query($sql) as $row) {
         $stats['status']["total"] += $row["cnt"];
         if (!isset($stats['status'][$row["ticketstatustitle"]])) {
             $stats['status'][$row["ticketstatustitle"]] = 0;
         }
         $stats['status'][$row["ticketstatustitle"]] += $row["cnt"];
         if (!isset($stats['user'][$row["ownerstaffname"]])) {
             $stats['user'][$row["ownerstaffname"]] = array("total" => 0);
         }
         $stats['user'][$row["ownerstaffname"]]["total"] += $row["cnt"];
         if (!isset($stats['user'][$row["ownerstaffname"]][$row["ticketstatustitle"]])) {
             $stats['user'][$row["ownerstaffname"]][$row["ticketstatustitle"]] = 0;
         }
         $stats['user'][$row["ownerstaffname"]][$row["ticketstatustitle"]] += $row["cnt"];
     }
     if (isset($stats['user'][''])) {
         $stats['user']['Unassigned'] = $stats['user'][''];
         unset($stats['user']['']);
     }
     header('Content-type: application/json');
     echo json_encode($stats);
 }
開發者ID:TomCan,項目名稱:dashboard,代碼行數:28,代碼來源:kayakoController.php

示例6: getReminderDays

 /**
  * Get list of number of days before expiration day
  * to send reminder email to company
  *
  * @return array
  */
 public function getReminderDays()
 {
     $remindOnDaysStr = \Config::get('custom.remindOnDays');
     $remindOnDays = explode(',', $remindOnDaysStr);
     foreach ($remindOnDays as $key => $value) {
         $remindOnDays[$key] = intval(trim($value));
     }
     return $remindOnDays;
 }
開發者ID:vukanac,項目名稱:l5-admin-panel,代碼行數:15,代碼來源:LicenceReminderCalculator.php

示例7: boot

 /**
  * Get the users' material_categories.
  *
  * @return MaterialCategories
  */
 public static function boot()
 {
     parent::boot();
     static::creating(function ($user) {
         $key = \Config::get('app.key');
         $confirmation_code = hash_hmac('sha256', str_random(40), $key);
         $user->confirmation_code = $confirmation_code;
     });
 }
開發者ID:barooahn,項目名稱:MaterialsShare,代碼行數:14,代碼來源:User.php

示例8: boot

 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     if (\Schema::hasTable('configs')) {
         $configs = \App\Config::get();
         foreach ($configs as $config) {
             \Config::set($config->key, $config->value);
         }
     }
 }
開發者ID:ZeljkoDzafic,項目名稱:AeroMeter,代碼行數:14,代碼來源:ConfigServiceProvider.php

示例9: isComponentReady

 protected function isComponentReady($component)
 {
     $compoTick = Config::get($component . 'Last');
     $compoTick += Config::get($component . 'Interval');
     if ($compoTick <= $this->tickCnt || $compoTick - 1440 > $this->tickCnt) {
         return true;
     } else {
         return false;
     }
 }
開發者ID:roslairy,項目名稱:nofetch,代碼行數:10,代碼來源:NoFManager.php

示例10: doRequest

 private function doRequest($payload)
 {
     if ($this->guzzle == null) {
         $conf = Config::get();
         $baseurl = $conf["zabbix"]["url"];
         $this->guzzle = new Client(array('cookies' => true, 'base_uri' => $baseurl));
     }
     //        var_dump($payload);
     $response = $this->guzzle->request('POST', 'api_jsonrpc.php', array('body' => $payload, 'headers' => array('content-type' => 'application/json-rpc')));
     return $response->getBody()->getContents();
 }
開發者ID:TomCan,項目名稱:dashboard,代碼行數:11,代碼來源:zabbixController.php

示例11: __construct

 public function __construct()
 {
     try {
         $this->db = new \PDO(Config::get('database.providers.pdo.host'), Config::get('database.providers.pdo.user'), Config::get('database.providers.pdo.pass'), array(\PDO::ATTR_PERSISTENT => true));
         $this->db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
         $this->connected = true;
     } catch (\PDOException $e) {
         $this->connected = false;
         die($e->getMessage());
     }
 }
開發者ID:adrielov,項目名稱:Chalenge-SOFTBOX,代碼行數:11,代碼來源:PdoAdapter.php

示例12: getPermissionsIdsArr

 public function getPermissionsIdsArr()
 {
     $permissions_rows = \DB::table(\Config::get('entrust.permission_role_table'))->where('role_id', '=', $this->id)->get(['permission_id']);
     if (empty($permissions_rows)) {
         return [];
     }
     $permissions_ids_arr = [];
     foreach ($permissions_rows as $permission_row) {
         $permissions_ids_arr[] = $permission_row->permission_id;
     }
     return $permissions_ids_arr;
 }
開發者ID:serovvitaly,項目名稱:kotik,代碼行數:12,代碼來源:Role.php

示例13: getRolesIdsArr

 public function getRolesIdsArr()
 {
     $roles_rows = \DB::table(\Config::get('entrust.role_user_table'))->where('user_id', '=', $this->id)->get(['role_id']);
     if (empty($roles_rows)) {
         return [];
     }
     $roles_ids_arr = [];
     foreach ($roles_rows as $role_row) {
         $roles_ids_arr[] = $role_row->role_id;
     }
     return $roles_ids_arr;
 }
開發者ID:serovvitaly,項目名稱:kotik,代碼行數:12,代碼來源:User.php

示例14: boot

 public static function boot()
 {
     parent::boot();
     // Hack for Entrust because it doesn't have a boot method
     static::deleting(function ($user) {
         if (!method_exists(Config::get('auth.model'), 'bootSoftDeletingTrait')) {
             $user->roles()->sync([]);
         }
         return true;
     });
     static::bootStapler();
 }
開發者ID:natalieduong,項目名稱:konnection,代碼行數:12,代碼來源:User.php

示例15: indexAction

 public function indexAction()
 {
     header('Content-type: application/json');
     $screens = Config::get('screens');
     $ret = [];
     foreach ($screens as $screen) {
         $obj = new \stdClass();
         $obj->type = $screen;
         $ret[] = $obj;
     }
     return json_encode(array("screens" => $ret));
 }
開發者ID:TomCan,項目名稱:dashboard,代碼行數:12,代碼來源:screensController.php


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