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


PHP Config::getSetting方法代码示例

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


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

示例1: setKey

 /**
  * Create cipher key.
  *
  * @return string
  */
 public function setKey()
 {
     if (!$this->key) {
         $this->key = md5(sha1(Config::getSetting('cipher_key')));
     }
     return $this->key;
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:12,代码来源:Crypt.php

示例2: connect

 /**
  * Connect to database.
  *
  * @return void
  */
 public function connect()
 {
     try {
         $this->dbh = new PDO(Config::getSetting('db_type') . ':unix_socket=/var/run/mysqld/mysqld.sock;dbname=' . Config::getSetting('db_name') . ';host=' . Config::getSetting('db_host'), Config::getSetting('db_user'), Config::getSetting('db_pass'));
         $this->query("SET CHAR SET UTF8");
     } catch (PDOException $e) {
         echo 'Connection failed: ' . $e->getMessage();
     }
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:14,代码来源:Database.php

示例3: sendMail

 /**
  * Parse template and send mail.
  *
  * @param string $to Send to this address.
  *
  * @return boolean
  */
 public function sendMail($to, $subject, $from = null, $fromname = null)
 {
     $this->From = $from ? $from : Config::getSetting('mail_from');
     $this->FromName = $fromname ? $fromname : Config::getSetting('mail_from_name');
     $this->Subject = $subject;
     $this->IsHTML(true);
     $this->Body = $this->fetchTemplate();
     $this->AddAddress($to);
     return $this->Send();
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:17,代码来源:TemplateMailer.php

示例4: __construct

 /**
  * Main Constructor
  *
  * @access	public
  * @return	void
  */
 public function __construct()
 {
     $this->setRichness(Config::getSetting('functionalRichness'));
     if (\DynamicPageListHooks::isLikeIntersection()) {
         $this->data['ordermethod'] = ['default' => 'categoryadd', 'values' => ['categoryadd', 'lastedit', 'none']];
         $this->data['order'] = ['default' => 'descending', 'values' => ['ascending', 'descending']];
         $this->data['mode'] = ['default' => 'unordered', 'values' => ['none', 'ordered', 'unordered']];
         $this->data['userdateformat'] = ['default' => 'Y-m-d: '];
         $this->data['allowcachedresults']['default'] = 'true';
     }
 }
开发者ID:hexmode,项目名称:DynamicPageList,代码行数:17,代码来源:ParametersData.php

示例5: saveData

 /**
  * Save data to cache.
  *
  * @param string  $key   Data to save as.
  * @param mixed   $value Data to save.
  * @param boolean $db    Cache to database.
  *
  * @return void
  */
 public static function saveData($key, $value, $db = false)
 {
     $cache = Cache::getInstance();
     $cache->data[$key] = $value;
     if ($key != 'ModelCachingFields' && $db && Config::getSetting('cache_to_database', false, false) && Clockwork::isModuleLoaded('Data/Database')) {
         $lifespan = $db === true ? 0 : $db;
         if (($obj = Caching::create($key, '*`key`')) === false) {
             $obj = new Caching();
         }
         $obj->set('key', $key)->set('value', serialize($value))->set('object', is_object($value) ? get_class($value) : '')->set('lifespan', $lifespan)->save();
     }
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:21,代码来源:Cache.php

示例6: send

 /**
  * Send message. Omit parameters to get defaults form Config.
  *
  * @param string $from     From email address.
  * @param string $fromname From name.
  * @param string $bcc      Send message BCC to this address.
  *
  * @return boolean
  */
 public function send($from = null, $fromname = null, $bcc = null)
 {
     $this->mailer->From = $from ? $from : Config::getSetting('mail_from');
     $this->mailer->FromName = $fromname ? $fromname : Config::getSetting('mail_from_name');
     $this->mailer->Subject = $this->subject;
     $this->mailer->IsHTML(true);
     $this->mailer->Body = $this->message;
     $this->mailer->AddAddress($this->to);
     if ($bcc) {
         $this->mailer->AddBCC($bcc);
     }
     return $this->mailer->Send();
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:22,代码来源:Mailer.php

示例7: getUser

 /**
  * Return logged in user
  *
  * @return object|boolean
  */
 public static function getUser($check = true)
 {
     if ($check && self::isLoggedIn() || !$check) {
         if (($user = Cache::loadData(static::$sessionKey)) === null) {
             $class = static::$className;
             if (($user = $class::create(sanitize($_SESSION[static::$sessionKey]), "*SHA1(MD5(CONCAT('" . Config::getSetting('salt') . "',  id)))")) !== false) {
                 Cache::saveData(static::$sessionKey, $user);
             } else {
                 unset($_SESSION[static::$sessionKey]);
                 redirect();
             }
         }
         return $user;
     } else {
         return false;
     }
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:22,代码来源:Login.php

示例8: get

 /**
  * Return a value.
  *
  * @param string  $key Value to return.
  * @param boolean $ret Set to true to return Date object instead of formatted date.
  *
  * @return mixed
  */
 public function get($key, $ret = false)
 {
     if ($ret !== -1 && ($field = $this->getFields($key)) && preg_match('/(date)/i', $field['Type'])) {
         if (isset($this->values[$key])) {
             if (Config::getSetting('check_empty_date')) {
                 if ($field['Type'] == 'datetime' && $this->values[$key] == '0000-00-00 00:00:00' || $field['Type'] == 'date' && $this->values[$key] == '0000-00-00') {
                     return null;
                 }
             }
             if (Clockwork::isModuleLoaded('Date')) {
                 $date = new Date($this->values[$key]);
                 if ($ret) {
                     return $date;
                 } else {
                     return $date->format();
                 }
             }
         } else {
             return null;
         }
     }
     return isset($this->values[$key]) ? $this->values[$key] : null;
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:31,代码来源:ModelObject.php

示例9: formatCategoryList

 public function formatCategoryList($iStart, $iCount)
 {
     for ($i = $iStart; $i < $iStart + $iCount; $i++) {
         $aArticles[] = $this->mArticles[$i]->mLink;
         $aArticles_start_char[] = $this->mArticles[$i]->mStartChar;
         $this->filteredCount = $this->filteredCount + 1;
     }
     if (count($aArticles) > Config::getSetting('categoryStyleListCutoff')) {
         return "__NOTOC____NOEDITSECTION__" . \CategoryViewer::columnList($aArticles, $aArticles_start_char);
     } elseif (count($aArticles) > 0) {
         // for short lists of articles in categories.
         return "__NOTOC____NOEDITSECTION__" . \CategoryViewer::shortList($aArticles, $aArticles_start_char);
     }
     return '';
 }
开发者ID:hexmode,项目名称:DynamicPageList,代码行数:15,代码来源:DynamicPageList.php

示例10: getFileURL

 function getFileURL()
 {
     if ($this->type == 'image') {
         // we get the area instance
         $url = SITE_WEB_DIRECTORY . MEDIA_BASE_DIRECTORY . '/' . $this->area_id . '/' . $this->filename;
     } else {
         if ($this->access == 'STREAMING') {
             include_class('config');
             $conf = new Config();
             $streamingAudioServerURL = $conf->getSetting('streamingAudioServerURL');
             $url = $streamingAudioServerURL . '/' . basename($this->protected_filename, Media::getExtension($this->protected_filename)) . 'pls';
         } else {
             $url = SITE_WEB_DIRECTORY . MEDIA_ORIGINALS_DIRECTORY . '/' . date('Ymd', strtotime($this->date_time)) . '/' . $this->filename_original;
         }
     }
     return $url;
 }
开发者ID:pinecreativelabs,项目名称:audition,代码行数:17,代码来源:m2.php

示例11: throwError

 /**
  * Throw an error and exit if needed
  *
  * @param string $error
  * @param int    $level      (optional, default = self::ERROR_FATAL)
  * @param int    $traceLevel (optional, default = 0)
  *
  * @return void
  */
 public static function throwError($error, $level = self::ERROR_FATAL, $traceLevel = 0)
 {
     if (!Config::getSetting('debug')) {
         return false;
     }
     $errors = array(0 => 'FATAL CLOCKWORK ERROR', 1 => 'CLOCKWORK WARNING');
     $trace = debug_backtrace();
     $trace = $trace[$traceLevel];
     if (isset($error[$level])) {
         echo '<br /><b>' . $errors[$level] . ':</b> ' . $error . ' in <b>' . $trace['file'] . '</b> on line <b>' . $trace['line'] . '</b><br />';
     } else {
         self::throwError('Invalid error level', self::ERROR_WARNING, 1);
     }
     if ($level == self::ERROR_FATAL) {
         exit;
     }
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:26,代码来源:Clockwork.php

示例12: path

 /**
  * Return [const]_[path|dir].
  * @author Jelle van der Coelen
  * @package Clockwork/Library/Path
  *
  * @param string $location Location to append to dir.
  * @param string $const    Constant to use.
  * @param string $type     Type of constant to use (path|dir).
  *
  * @return string
  */
 function path($location = '', $const = 'root', $type = 'path')
 {
     return Config::getSetting($const . '_' . $type) . $location;
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:15,代码来源:path.php

示例13: setupTwig

 /**
  * Setup Twig template engine
  *
  * @return void
  */
 public function setupTwig()
 {
     Twig_Autoloader::register(true);
     if (!is_dir($this->basedir . 'template/')) {
         Clockwork::throwError('Template directory (' . $this->basedir . 'template/) does not exists');
     }
     $paths = [$this->basedir . 'template/', APP_DIR . 'template/'];
     $plugins = Clockwork::getInstance()->loadedPlugins;
     foreach ($plugins as $plugin) {
         if (is_dir($plugin->dir() . 'template/')) {
             $paths[] = $plugin->dir() . 'template/';
         }
     }
     $loader = new Twig_Loader_Filesystem($paths);
     $this->twig = new Twig_Environment($loader, array('cache' => Config::getSetting('twig_cache') ? appdir('template/cache/') : false));
     $functions = get_defined_functions();
     foreach ($functions['user'] as $function) {
         if (strpos(strtolower($function), 'twig') === false) {
             $this->twig->addFunction(new Twig_SimpleFunction($function, $function));
         }
     }
     $this->twig->addFunction(new Twig_SimpleFunction('PluginLoader', [Clockwork::getInstance(), 'pluginLoader']));
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:28,代码来源:Template.php

示例14: join

 /**
  * Add a join.
  *  
  * @param string  $table  Table name to join on
  * @param string  $on     Where to join on.
  * @param string  $type   Type of join
  * @param boolean $prefix Prefix table with db_table_prefix from config.
  * @param boolean $reset  Clear all joins.
  *
  * @return self
  */
 public function join($table, $on, $type = 'INNER', $prefix = true, $reset = false)
 {
     if ($reset) {
         $this->join = array();
     }
     $this->join[] = $type . " JOIN " . ($prefix ? Config::getSetting('db_table_prefix') : '') . $table . " " . $this->alias($table) . " on " . $on;
     return $this;
 }
开发者ID:JCquence,项目名称:Clockwork,代码行数:19,代码来源:Query.php

示例15: _namespace

 /**
  * Clean and test 'namespace' parameter.
  *
  * @access	public
  * @param	string	Option passed to parameter.
  * @return	boolean	Success
  */
 public function _namespace($option)
 {
     global $wgContLang;
     $extraParams = explode('|', $option);
     foreach ($extraParams as $parameter) {
         $parameter = trim($parameter);
         $namespaceId = $wgContLang->getNsIndex($parameter);
         if ($namespaceId === false || is_array(Config::getSetting('allowedNamespaces')) && !in_array($parameter, Config::getSetting('allowedNamespaces'))) {
             //Let the user know this namespace is not allowed or does not exist.
             return false;
         }
         $data = $this->getParameter('namespace');
         $data[] = $namespaceId;
         $data = array_unique($data);
         $this->setParameter('namespace', $data);
         $this->setSelectionCriteriaFound(true);
     }
     return true;
 }
开发者ID:hexmode,项目名称:DynamicPageList,代码行数:26,代码来源:Parameters.php


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