当前位置: 首页>>代码示例>>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;未经允许,请勿转载。