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


PHP Config::Get方法代码示例

本文整理汇总了PHP中Config::Get方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::Get方法的具体用法?PHP Config::Get怎么用?PHP Config::Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Config的用法示例。


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

示例1: GetFavouritesByArray

 /**
  * Получить список избранного по списку айдишников
  *
  * @param  array  $aTargetId	Список ID владельцев
  * @param  string $sTargetType	Тип владельца
  * @param  int $sUserId	ID пользователя
  * @return array
  */
 public function GetFavouritesByArray($aTargetId, $sTargetType, $sUserId)
 {
     if (!$aTargetId) {
         return array();
     }
     if (Config::Get('sys.cache.solid')) {
         return $this->GetFavouritesByArraySolid($aTargetId, $sTargetType, $sUserId);
     }
     if (!is_array($aTargetId)) {
         $aTargetId = array($aTargetId);
     }
     $aTargetId = array_unique($aTargetId);
     $aFavourite = array();
     $aIdNotNeedQuery = array();
     /**
      * Делаем мульти-запрос к кешу
      */
     $aCacheKeys = func_build_cache_keys($aTargetId, "favourite_{$sTargetType}_", '_' . $sUserId);
     if (false !== ($data = $this->Cache_Get($aCacheKeys))) {
         /**
          * проверяем что досталось из кеша
          */
         foreach ($aCacheKeys as $sValue => $sKey) {
             if (array_key_exists($sKey, $data)) {
                 if ($data[$sKey]) {
                     $aFavourite[$data[$sKey]->getTargetId()] = $data[$sKey];
                 } else {
                     $aIdNotNeedQuery[] = $sValue;
                 }
             }
         }
     }
     /**
      * Смотрим чего не было в кеше и делаем запрос в БД
      */
     $aIdNeedQuery = array_diff($aTargetId, array_keys($aFavourite));
     $aIdNeedQuery = array_diff($aIdNeedQuery, $aIdNotNeedQuery);
     $aIdNeedStore = $aIdNeedQuery;
     if ($data = $this->oMapper->GetFavouritesByArray($aIdNeedQuery, $sTargetType, $sUserId)) {
         foreach ($data as $oFavourite) {
             /**
              * Добавляем к результату и сохраняем в кеш
              */
             $aFavourite[$oFavourite->getTargetId()] = $oFavourite;
             $this->Cache_Set($oFavourite, "favourite_{$oFavourite->getTargetType()}_{$oFavourite->getTargetId()}_{$sUserId}", array(), 60 * 60 * 24 * 7);
             $aIdNeedStore = array_diff($aIdNeedStore, array($oFavourite->getTargetId()));
         }
     }
     /**
      * Сохраняем в кеш запросы не вернувшие результата
      */
     foreach ($aIdNeedStore as $sId) {
         $this->Cache_Set(null, "favourite_{$sTargetType}_{$sId}_{$sUserId}", array(), 60 * 60 * 24 * 7);
     }
     /**
      * Сортируем результат согласно входящему массиву
      */
     $aFavourite = func_array_sort_by_keys($aFavourite, $aTargetId);
     return $aFavourite;
 }
开发者ID:olegverstka,项目名称:kprf.dev,代码行数:68,代码来源:Favourite.class.php

示例2: Exec

 /**
  * Запуск обработки
  */
 public function Exec()
 {
     /**
      * Получаем список тегов
      */
     $aTags = $this->oEngine->Topic_GetOpenTopicTags(Config::Get('block.tags.tags_count'));
     /**
      * Расчитываем логарифмическое облако тегов
      */
     if ($aTags) {
         $this->Tools_MakeCloud($aTags);
         /**
          * Устанавливаем шаблон вывода
          */
         $this->Viewer_Assign("aTags", $aTags);
     }
     /**
      * Теги пользователя
      */
     if ($oUserCurrent = $this->User_getUserCurrent()) {
         $aTags = $this->oEngine->Topic_GetOpenTopicTags(Config::Get('block.tags.personal_tags_count'), $oUserCurrent->getId());
         /**
          * Расчитываем логарифмическое облако тегов
          */
         if ($aTags) {
             $this->Tools_MakeCloud($aTags);
             /**
              * Устанавливаем шаблон вывода
              */
             $this->Viewer_Assign("aTagsUser", $aTags);
         }
     }
 }
开发者ID:cbrspc,项目名称:LIVESTREET-1-DISTRIB,代码行数:36,代码来源:BlockTags.class.php

示例3: isBad

 public function isBad()
 {
     if ($this->getRating() <= Config::Get('module.comment.bad')) {
         return true;
     }
     return false;
 }
开发者ID:lifecom,项目名称:test,代码行数:7,代码来源:Comment.entity.class.php

示例4: EventLogin

 /**
  * Обрабатываем процесс залогинивания
  *
  */
 protected function EventLogin()
 {
     /**
      * Если нажали кнопку "Войти"
      */
     if (isPost('submit_login') and is_string(getRequest('login')) and is_string(getRequest('password'))) {
         /**
          * Проверяем есть ли такой юзер по логину
          */
         if (func_check(getRequest('login'), 'mail') and $oUser = $this->User_GetUserByMail(getRequest('login')) or $oUser = $this->User_GetUserByLogin(getRequest('login'))) {
             /**
              * Сверяем хеши паролей и проверяем активен ли юзер
              */
             if ($oUser->getPassword() == func_encrypt(getRequest('password')) and $oUser->getActivate()) {
                 $bRemember = getRequest('remember', false) ? true : false;
                 /**
                  * Авторизуем
                  */
                 $this->User_Authorization($oUser, $bRemember);
                 /**
                  * Перенаправляем на страницу с которой произошла авторизация
                  */
                 if (isset($_SERVER['HTTP_REFERER'])) {
                     $sBackUrl = $_SERVER['HTTP_REFERER'];
                     if (strpos($sBackUrl, Router::GetPath('login')) === false) {
                         Router::Location($sBackUrl);
                     }
                 }
                 Router::Location(Config::Get('path.root.web') . '/');
             }
         }
         $this->Viewer_Assign('bLoginError', true);
     }
     $this->Viewer_AddHtmlTitle($this->Lang_Get('login'));
 }
开发者ID:lifecom,项目名称:Huddlebuddle,代码行数:39,代码来源:ActionLogin.class.php

示例5: set

 public function set($key, $value)
 {
     $this->check();
     if (memcache_set($this->connection, $key, $value, 0, Config::Get('cache_time')) === false) {
         throw new CacheException("Couldn't store data in cache");
     }
 }
开发者ID:jkinner,项目名称:ringside,代码行数:7,代码来源:CacheMemcache.php

示例6: savepro

 public function savepro()
 {
     if ($this->post->firstname == '' || $this->post->lastname == '') {
         $this->set('message', 'The first or lastname cannot be blank!');
         $this->render('core_error.tpl');
         return;
     }
     $params = array('firstname' => $this->post->firstname, 'lastname' => $this->post->lastname, 'email' => $this->post->email, 'hub' => $this->post->hub, 'retired' => $this->post->retired, 'totalflights' => $this->post->totalflights, 'totalpay' => floatval($this->post->totalpay), 'transferhours' => $this->post->transferhours);
     PilotData::updateProfile($this->post->pilotid, $params);
     PilotData::SaveFields($this->post->pilotid, $_POST);
     /* Don't calculate a pilot's rank if this is set */
     if (Config::Get('RANKS_AUTOCALCULATE') == false) {
         PilotData::changePilotRank($this->post->pilotid, $this->post->rank);
     } else {
         RanksData::calculateUpdatePilotRank($this->post->pilotid);
     }
     StatsData::UpdateTotalHours();
     $this->set('message', 'Profile updated successfully');
     $this->render('core_success.tpl');
     $this->set('pilots', PilotData::getAllPilots());
     $this->render('/pm/pilot_manager.php');
     if ($this->post->resend_email == 'true') {
         $this->post->id = $this->post->pilotid;
         $this->resendemail(false);
     }
     $pilot = PilotData::getPilotData($this->post->pilotid);
     LogData::addLog(Auth::$userinfo->pilotid, 'Updated profile for ' . PilotData::getPilotCode($pilot->code, $pilot->pilotid) . ' ' . $pilot->firstname . ' ' . $pilot->lastname);
     return;
     break;
 }
开发者ID:parkho,项目名称:Pilot-Manager-V2.2,代码行数:30,代码来源:Pilotmanager.php

示例7: before

 public function before($controller, $metadata, &$data)
 {
     if (!$controller->request->input->exists('app_id')) {
         throw new BadRequestException("Missing app id.");
     }
     $conf = Config::Get('apps');
     $app = $conf->{$controller->request->input->app_id};
     if (!$app->signed) {
         return;
     }
     if (!$controller->request->input->exists('app_id', 'signature', 'time')) {
         throw new BadRequestException("Missing signature.");
     }
     $signature = str_replace(' ', '+', $controller->request->input->signature);
     $vals = array();
     foreach ($controller->request->input as $key => $val) {
         if (!in_array($key, array('signature', 'time'))) {
             $vals[$key] = $val;
         }
     }
     $sig = sign($vals, $app->key, $controller->request->input->time);
     if ($sig['signature'] != $signature) {
         throw new BadRequestException("Invalid signature.");
     }
 }
开发者ID:jawngee,项目名称:HeavyMetal,代码行数:25,代码来源:signed.php

示例8: __construct

 public function __construct($config = null)
 {
     $config = $config ? $config : Config::Get('mandao');
     $this->account = $config['account'];
     $this->passwd = $config['passwd'];
     $this->perfix = $config['perfix'];
 }
开发者ID:jesse108,项目名称:admin_base,代码行数:7,代码来源:Mandao.class.php

示例9: Exec

 public function Exec()
 {
     $aBanners = $this->GetParam('aBanners');
     $this->PluginBanneroid_ModuleBanner_AddBannerStats(array('banner_id' => $aBanners[0]->getId(), 'event' => 'SHOW'));
     $this->Viewer_Assign("oBanner", $aBanners[0]);
     $this->Viewer_Assign('sBannersPath', Config::Get("plugin.banneroid.images_dir"));
 }
开发者ID:netlanc,项目名称:ls-plugin-banneroid,代码行数:7,代码来源:BlockBanneroid.class.php

示例10: Log

 /**
  * Делает запись в лог
  *
  * @param  string $sMsg	Сообщение для записи в лог
  */
 public function Log($sMsg)
 {
     if ($this->bLogEnable and Config::Get('sys.logs.cron')) {
         $sMsg = $this->sProcessName . ': ' . $sMsg;
         $this->Logger_Notice($sMsg, array(), 'cron');
     }
 }
开发者ID:KaMaToZzz,项目名称:livestreet-framework,代码行数:12,代码来源:Cron.class.php

示例11: GetMailer

 public static function GetMailer($address = '')
 {
     $emailConfig = Config::Get('email');
     $currentConfig = $emailConfig[$address] ? $emailConfig[$address] : $emailConfig['default'];
     $address = $currentConfig['address'];
     if (!$currentConfig) {
         return false;
     }
     if (!self::$phpMailers[$address]) {
         $mailer = new PHPMailer();
         $mailer->isSMTP();
         $mailer->Host = $currentConfig['stmp_host'];
         $mailer->Username = $currentConfig['user'];
         $mailer->Password = $currentConfig['pwd'];
         $mailer->SMTPAuth = true;
         $mailer->Port = $currentConfig['port'];
         $mailer->CharSet = "utf-8";
         $mailer->setFrom($currentConfig['address']);
         $mailer->isHTML();
     } else {
         $mailer = self::$phpMailers[$address];
     }
     $mailer->clearAllRecipients();
     self::$phpMailers[$address] = $mailer;
     return $mailer;
 }
开发者ID:jesse108,项目名称:admin_base,代码行数:26,代码来源:Mail.class.php

示例12: InitAction

 public function InitAction($aVars)
 {
     $oLang = $this->Lang_Dictionary();
     $this->Viewer_Assign('oLang', $oLang);
     $oUser = $this->GetUser();
     if ($oUser && $oUser->IsAdministrator() && Config::Get('plugin.' . $this->sPlugin . '.' . 'icon_menu')) {
         $sScript = Plugin::GetTemplateWebPath($this->sPlugin) . 'js/' . 'icon_menu.js';
         $this->Viewer_AppendScript($sScript);
     }
     if (Router::GetAction() == 'admin' || Router::GetAction() == 'error') {
         return;
     }
     if (!$oUser) {
         if (Router::GetAction() == 'registration') {
             $aIp = admGetAllUserIp();
             foreach ($aIp as $sIp) {
                 if ($this->PluginAceadminpanel_Admin_IsBanIp($sIp)) {
                     $this->Message_AddErrorSingle($this->Lang_Get('adm_banned2_text'), $this->Lang_Get('adm_denied_title'));
                     return $this->UserBanned(null);
                 }
             }
         }
         return;
     }
     if (defined('ADMIN_SITE_CLOSED') && ADMIN_SITE_CLOSED && !$oUser->IsAdministrator()) {
         $this->SiteClosed();
     }
     if ($oUser->IsBannedByLogin() || $oUser->IsBannedByIp() && !$oUser->IsAdministrator()) {
         return $this->UserBanned($oUser);
     }
 }
开发者ID:lifecom,项目名称:test,代码行数:31,代码来源:HookAdmin.class.php

示例13: resetdistances

 public function resetdistances()
 {
     echo '<h3>Updating and Calculating Distances</h3>';
     # Update all of the schedules
     echo '<p><strong>Updating schedules...</strong></p>';
     //$allschedules = SchedulesData::GetSchedulesNoDistance();
     $allschedules = SchedulesData::findSchedules(array());
     if (!$allschedules) {
         echo 'No schedules to update';
         $allschedules = array();
     }
     # Check 'em
     foreach ($allschedules as $sched) {
         $distance = SchedulesData::distanceBetweenPoints($sched->deplat, $sched->deplng, $sched->arrlat, $sched->arrlng);
         $distance = sprintf("%.6f", $distance);
         echo "{$sched->code}{$sched->flightnum} - {$sched->depname} to {$sched->arrname} " . "is {$distance} " . Config::Get('UNIT') . '<br />';
         SchedulesData::updateScheduleFields($sched->id, array('distance' => $distance));
     }
     # Update all of the PIREPS
     echo '<p><strong>Updating PIREPs...</strong></p>';
     $allpireps = PIREPData::findPIREPS(array());
     if (!$allpireps) {
         echo 'No PIREPs need updating!';
         $allpireps = array();
     }
     foreach ($allpireps as $pirep) {
         # Find the schedule, and the distance supplied by the schedule:
         $distance = SchedulesData::distanceBetweenPoints($pirep->deplat, $pirep->deplng, $pirep->arrlat, $pirep->arrlng);
         $distance = sprintf("%.2f", $distance);
         echo "PIREP Number {$pirep->pirepid} ({$pirep->code}{$pirep->flightnum}) " . "{$pirep->depname} to {$pirep->arrname} is {$distance} " . Config::Get('UNIT') . '<br />';
         PIREPData::editPIREPFields($pirep->pirepid, array('distance' => $distance));
     }
     echo '<p>Completed!</p><br />';
     LogData::addLog(Auth::$userinfo->pilotid, 'Reset distances');
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:35,代码来源:Maintenance.php

示例14: LoadModules

 public function LoadModules()
 {
     Std::Out();
     Std::Out('[Info] [Modules] Loading');
     Std::Out('[Info] [Modules] Available languages: ' . implode(', ', $this->GetAvailableLanguages(false)));
     $Modules = Config::Get('Modules');
     if (is_array($Modules)) {
         $Loaded = array();
         $Keys = array_keys($Modules);
         foreach ($Keys as $Key) {
             foreach ($Modules[$Key] as $Module) {
                 if (is_string($Module)) {
                     $Module = array($Module, $Module);
                 }
                 if (is_array($Module) && !empty($Module[0]) && !empty($Module[1])) {
                     $Name = strtolower($Module[0]);
                     $Loaded[$Key][$Name] = $this->LoadModule($Key, $Name, $Module[1]);
                 } else {
                     Std::Out('[Warning] [Modules] Config must be Key::Name or Key::[Name, AliasOf]');
                     Std::Out("{$Key}::", false);
                     Std::Out(var_export($Module, true));
                 }
             }
         }
         Std::Out('[Info] [Modules] Ready!');
         // ($N loaded modules)
         return $Loaded;
     }
     Std::Out('[Warning] [Modules] Config file is not an array');
     return false;
 }
开发者ID:RhuanGonzaga,项目名称:WhatsBot,代码行数:31,代码来源:ModuleManagerLoader.php

示例15: Activate

 /**
  * Активация плагина.
  */
 public function Activate()
 {
     $aSqlConf = array(array('field' => 'topic_fixed', 'table' => Config::Get('db.table.topic'), 'file' => dirname(__FILE__) . '/sql/topic.sql'));
     $this->exportSqlIfNeed($aSqlConf);
     $this->Cache_Clean();
     return true;
 }
开发者ID:lifecom,项目名称:test,代码行数:10,代码来源:PluginTopicfix.class.php


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