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


PHP Config函数代码示例

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


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

示例1: make

 public function make()
 {
     $options = Config('session.memcache');
     $this->memcache = new Memcache();
     $this->memcache->connect($options['host'], $options['port']);
     session_set_save_handler(array(&$this, "open"), array(&$this, "close"), array(&$this, "read"), array(&$this, "write"), array(&$this, "destroy"), array(&$this, "gc"));
 }
开发者ID:ChenHuaPHP,项目名称:ZOLshop,代码行数:7,代码来源:Memcache.php

示例2: getClassesName

 /**
  * 根据班级id获取具体班级名称(一个)
  *
  * @return string
  * @author Hunter.<990835774@qq.com>
  */
 public function getClassesName()
 {
     $classesId = $this->getClassesId();
     //根据当前用户的班级值获取对应的班级信息(包括年级)
     $classesInfo = Classes::findFirst($classesId);
     return Config('CONFIG_GRADE')[$classesInfo->getGradeId()] . $classesInfo->getName();
 }
开发者ID:ylh990835774,项目名称:phalcon_ydjc,代码行数:13,代码来源:User.php

示例3: refresh

 public static function refresh()
 {
     $posts = collect(self::wp_get('get_posts')['posts']);
     $posts->each(function ($item) {
         //delete all previous posts
         if (\Config('cache.default') == 'redis') {
             Redis::pipeline(function ($pipe) {
                 foreach (Redis::keys('laravel:a440:wordpress:posts_*') as $key) {
                     $pipe->del($key);
                 }
             });
         }
         Cache::forever('a440:wordpress:posts_' . $item['id'], $item);
     });
     Cache::forever('a440:wordpress:posts', $posts->transform(function ($item) {
         unset($item['content']);
         unset($item['url']);
         unset($item['status']);
         unset($item['title_plain']);
         unset($item['modified']);
         unset($item['categories']);
         unset($item['comments']);
         unset($item['attachments']);
         unset($item['comment_count']);
         unset($item['comment_status']);
         unset($item['thumbnail']);
         unset($item['custom_fields']);
         unset($item['thumbnail_size']);
         unset($item['thumbnail_images']['full']);
         unset($item['thumbnail_images']['thumbnail']);
         unset($item['thumbnail_images']['post-thumbnail']);
         return $item;
     }));
     Cache::forever('a440:wordpress:categories', collect(self::wp_get('get_category_index')['categories']));
 }
开发者ID:a4x,项目名称:laravel-wordpress,代码行数:35,代码来源:Wordpress.php

示例4: messages

 /**
  * Change Language from user choose.
  *
  * @return array
  */
 public function messages()
 {
     if (in_array($this->session()->get('lang'), Config('admin.listTransLang'))) {
         return ['location_name.required' => trans('banner_messages.locationName') . ' ' . trans('error.required'), 'location_name.alpha_dash' => trans('banner_messages.locationName') . ' ' . trans('error.alpha_dash'), 'limit.required' => trans('banner_messages.limit') . ' ' . trans('error.required'), 'limit.integer' => trans('banner_messages.limit') . ' ' . trans('error.integer'), 'status.required' => trans('banner_messages.status') . ' ' . trans('error.required'), 'status.integer' => trans('banner_messages.status') . ' ' . trans('error.integer'), 'width.required' => trans('banner_messages.sizeWidth') . ' ' . trans('error.required'), 'width.integer' => trans('banner_messages.sizeWidth') . ' ' . trans('error.integer'), 'height.required' => trans('banner_messages.sizeHeight') . ' ' . trans('error.required'), 'height.integer' => trans('banner_messages.sizeHeight') . ' ' . trans('error.integer')];
     }
     return [];
 }
开发者ID:pakaya16,项目名称:laravelproject,代码行数:12,代码来源:LocationRequest.php

示例5: send

 public function send(Msg $msg)
 {
     // Get template file path.
     $templatePath = SPrintF('Notifies/SMS/%s.tpl', $msg->getTemplate());
     $smarty = JSmarty::get();
     if (!$smarty->templateExists($templatePath)) {
         throw new jException('Template file not found: ' . $templatePath);
     }
     $smarty->assign('Config', Config());
     foreach (array_keys($msg->getParams()) as $paramName) {
         $smarty->assign($paramName, $msg->getParam($paramName));
     }
     try {
         $message = $smarty->fetch($templatePath);
     } catch (Exception $e) {
         throw new jException(SPrintF("Can't fetch template: %s", $templatePath), $e->getCode(), $e);
     }
     $recipient = $msg->getParam('User');
     if (!$recipient['Params']['NotificationMethods']['SMS']['Address']) {
         throw new jException('Mobile phone number not found for user: ' . $recipient['ID']);
     }
     $taskParams = array('UserID' => $recipient['ID'], 'TypeID' => 'SMS', 'Params' => array($recipient['Params']['NotificationMethods']['SMS']['Address'], $message, $recipient['ID'], $msg->getParam('ChargeFree') ? TRUE : FALSE));
     #Debug(SPrintF('[system/classes/SMS.class.php]: msg = %s,',print_r($msg,true)));
     $result = Comp_Load('www/Administrator/API/TaskEdit', $taskParams);
     switch (ValueOf($result)) {
         case 'error':
             throw new jException("Couldn't add task to queue: " . $result);
         case 'exception':
             throw new jException("Couldn't add task to queue: " . $result->String);
         case 'array':
             return TRUE;
         default:
             throw new jException("Unexpected error.");
     }
 }
开发者ID:carriercomm,项目名称:jbs,代码行数:35,代码来源:SMS.class.php

示例6: getBreadcrumbTpl

 public function getBreadcrumbTpl($appendLinks = true, $separator = ' > ')
 {
     $links = [];
     $total = count($this->_breadcrumb);
     $index = 0;
     $currentPath = null;
     $base_url = Config('main')->ROUTING['BASE_URL'];
     foreach ($this->_breadcrumb as $level) {
         if (substr($level['link'], 0, 1) === '/') {
             $link = $base_url . substr($level['link'], 1);
         } else {
             $link = $level['link'];
         }
         if ($appendLinks) {
             $currentPath .= $link;
         } else {
             $currentPath = $link;
         }
         if (++$index < $total) {
             $links[] = '<a href="' . $currentPath . '">' . $level['label'] . '</a>';
         } else {
             $links[] = '<span>' . $level['label'] . '</span>';
         }
     }
     return join($separator, $links);
 }
开发者ID:Tailszefox,项目名称:Eliya,代码行数:26,代码来源:Controller.class.php

示例7: __construct

 public function __construct($auth_other = null)
 {
     $this->auth_other = $auth_other;
     if ($this->auth_other === null) {
         $this->auth_other = Config('AUTH_OTHER');
     }
 }
开发者ID:a1586256143,项目名称:MyClassPHP,代码行数:7,代码来源:Auth.class.php

示例8: CreateModel

 /**
  * 创建模型类
  * @param name 控制器名称
  * @author Colin <15070091894@163.com>
  */
 public static function CreateModel($name)
 {
     $model = $name . Config('DEFAULT_MODEL_SUFFIX');
     $modelexplode = explode('\\', $name);
     //得到最后一个值
     $modelname = array_pop($modelexplode);
     return new $model($modelname);
 }
开发者ID:a1586256143,项目名称:MyClassPHP,代码行数:13,代码来源:ObjFactory.class.php

示例9: getFilenameOrPath

 /**
  * 获取文件名以及路径
  */
 protected function getFilenameOrPath($FileName)
 {
     if (empty($FileName)) {
         $FileName = METHOD_NAME;
     }
     $path = $this->view->template_dir . CONTROLLER_NAME . '/' . $FileName . Config('TPL_TYPE');
     return $path;
 }
开发者ID:a1586256143,项目名称:MyClassPHP,代码行数:11,代码来源:Controller.class.php

示例10: login

 public function login(AuthenticateUser $authenticateUser, Request $request, $provider = null)
 {
     if (is_null($provider)) {
         return view(Config('constants.frontView') . '.login');
     } else {
         return $authenticateUser->execute(Request::all(), $this, $provider);
     }
 }
开发者ID:sushilcs111,项目名称:td,代码行数:8,代码来源:UserController.php

示例11: setArrayConfigProxy

 protected function setArrayConfigProxy($keyConfigProxy = 'proxy')
 {
     $this->configProxy = [];
     if (class_exists('Config') && !is_null(Config($keyConfigProxy))) {
         //Verificação para config class do Laravel
         $this->configProxy = Config($keyConfigProxy);
     }
     return $this;
 }
开发者ID:mkillua,项目名称:laravel-pagseguro,代码行数:9,代码来源:Proxy.php

示例12: __construct

 public function __construct()
 {
     $this->charset = Config('CODE_CHARSET');
     $this->codelen = Config('CODE_LENGTH');
     $this->width = Config('CODE_WIDTH');
     $this->height = Config('CODE_HEIGHT');
     $this->fontsize = Config('CODE_FONTSIZE');
     $this->font = Config('CODE_FONTPATH');
 }
开发者ID:a1586256143,项目名称:MyClassPHP,代码行数:9,代码来源:Code.class.php

示例13: templateName

 public function templateName()
 {
     $template = Config('lara-cms.master.template');
     if (isset($template[$this->template])) {
         return $template[$this->template];
     } else {
         return null;
     }
 }
开发者ID:suroviy,项目名称:xcore,代码行数:9,代码来源:Page.php

示例14: getKey

 public function getKey()
 {
     $mac = shell_exec("ifconfig | awk '/eth/{print \$5}'");
     $ip = trim(`ifconfig eth0|grep -oE '([0-9]{1,3}\\.?){4}'|head -n 1`);
     $mac = trim(str_replace(':', '.', $mac));
     $domain = trim(str_replace(':', '.', \Config('app.www_domain')));
     $key = $domain . ':' . $mac . ':' . \Config('app.application_name') . ':' . (empty($_SESSION['enterprise_id']) ? 'sys' : $_SESSION['enterprise_id']);
     return $key;
 }
开发者ID:qycloud,项目名称:ant_utils,代码行数:9,代码来源:Ay_log_send.php

示例15: edit

 public function edit()
 {
     //  dd(Helper::test());
     $attrs = Attribute::find(Input::get('id'));
     $attrSets = AttributeSet::get(['id', 'attr_set'])->toArray();
     $attr_types = AttributeType::all();
     $action = route("admin.attrs.save");
     return view(Config('constants.adminAttrView') . '.addEdit', compact('attrs', 'attrSets', 'action', 'attr_types'));
 }
开发者ID:sushilcs111,项目名称:sourcesunlimited,代码行数:9,代码来源:AttributesController.php


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