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


PHP Config::create方法代码示例

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


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

示例1: register

 static function register($table, $key, $value = "")
 {
     // create the global config object if not available
     if (!array_key_exists('config', $GLOBALS)) {
         $GLOBALS['config'] = array();
     }
     // exit now if variable already available
     $key_exists = array_key_exists($table, $GLOBALS['config']) && array_key_exists($key, $GLOBALS['config'][$table]) && !(empty($GLOBALS['config'][$table][$key]) && is_null($GLOBALS['config'][$table][$key]));
     if ($key_exists) {
         return;
     }
     // then check if the table exists
     if (empty($GLOBALS['config'][$table])) {
         $config = new Config(0, $table);
         // FIX: The id needs to be setup as autoincrement
         //$config->create_table($table, "id INTEGER PRIMARY KEY ASC," . implode(",", array_keys( $config->rs )) );
         $config->create_table($table, "id INTEGER PRIMARY KEY ASC, key, value");
         $GLOBALS['config'][$table] = array();
     }
     // we already know the key doesn't exist - just create it
     $config = new Config(0, $table);
     $config->set('key', "{$key}");
     // FIX: special case for admin password (use cipher if available)
     $cipher = is_null(CIPHER) ? $value : CIPHER;
     $value = $key == "admin_password" ? crypt($value, $cipher) : $value;
     $config->set('value', "{$value}");
     $config->create();
     // save in the global object
     $GLOBALS['config'][$table][$key] = $value;
 }
开发者ID:makesites,项目名称:kisscms,代码行数:30,代码来源:Config.php

示例2: __construct

 public function __construct(Config $config = null)
 {
     $this->config = $config;
     if (!$config) {
         $this->config = Config::create();
     }
 }
开发者ID:501st-alpha1,项目名称:Specify,代码行数:7,代码来源:ConfigBuilder.php

示例3: __construct

 /**
  * เรียกใช้งาน Class แบบสามารถเรียกได้ครั้งเดียวเท่านั้น
  *
  * @param array $config ค่ากำหนดของ แอพพลิเคชั่น
  * @return Singleton
  */
 public function __construct()
 {
     /* display error */
     if (defined('DEBUG') && DEBUG === true) {
         /* ขณะออกแบบ แสดง error และ warning ของ PHP */
         ini_set('display_errors', 1);
         ini_set('display_startup_errors', 1);
         error_reporting(-1);
     } else {
         /* ขณะใช้งานจริง */
         error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);
     }
     /* config */
     self::$cfg = \Config::create();
     /* charset default UTF-8 */
     ini_set('default_charset', self::$char_set);
     if (extension_loaded('mbstring')) {
         mb_internal_encoding(self::$char_set);
     }
     /* inint Input */
     Input::normalizeRequest();
     // template ที่กำลังใช้งานอยู่
     Template::inint(Input::get($_GET, 'skin', self::$cfg->skin));
     /* time zone default Thailand */
     @date_default_timezone_set(self::$cfg->timezone);
 }
开发者ID:roongr2k7,项目名称:kotchasan,代码行数:32,代码来源:kotchasan.php

示例4: __construct

 public function __construct()
 {
     $conf = Config::create()->getConf();
     $this->host = $conf['host'];
     $this->database = $conf['database'];
     $this->login = $conf['login'];
     $this->password = $conf['password'];
     $this->connect();
 }
开发者ID:rozmarin-2013,项目名称:test_news,代码行数:9,代码来源:Db.php

示例5: init

 public function init($name)
 {
     if (self::STATUS_EMPTY != $this->status) {
         throw new Exception('a mydbvc library already exists.');
     }
     if (!Config::create($this->root . 'mydbvc.yaml', $name) || !$this->repair()) {
         return false;
     }
     return true;
 }
开发者ID:panlatent,项目名称:mydbvc,代码行数:10,代码来源:Core.php

示例6: getByKeysAsArray

 /**
  * @param array $keys
  * @param User  $user
  * @param int   $profile_id
  *
  * @return array
  */
 public static function getByKeysAsArray($keys, $user, $profile_id)
 {
     $config = Config::create()->where('key', $keys[0])->get(1);
     $return = array();
     $available_configs = $config->available_config->get()->all_to_array();
     foreach ($available_configs as $available_config) {
         $tokens = Access_token::getAllByTypeAndUserIdAndProfileIdAsArray($available_config['type'], $user->id, $profile_id);
         $config = new Config($available_config['config_id']);
         $config = $config->to_array();
         foreach ($tokens as $token) {
             $_element = array('token' => $token, 'config' => $config, 'values' => array());
             foreach ($keys as $key) {
                 $_element['values'][$key] = $user->ifUserHasConfigValue($key, $token['id']);
             }
             $return[$available_config->type][] = $_element;
         }
     }
     return $return;
 }
开发者ID:andrewkrug,项目名称:repucaution,代码行数:26,代码来源:available_config.php

示例7:

<?php

namespace Dotink\Inkwell;

return Config::create(['Library'], ['restless' => TRUE]);
开发者ID:dotink,项目名称:inkwell-2.0,代码行数:5,代码来源:router.php

示例8:

<?php

namespace Dotink\Inkwell;

return Config::create(['Library'], ['root_directory' => 'external/testing/views']);
开发者ID:dotink,项目名称:inkwell-2.0,代码行数:5,代码来源:view.php

示例9:

<?php

namespace Dotink\Inkwell;

return Config::create(['Core'], ['disabled' => FALSE, 'map' => ['default' => ['namespace' => 'App\\Model', 'connection' => ['driver' => NULL, 'dbname' => NULL, 'host' => NULL, 'port' => NULL, 'user' => NULL, 'password' => NULL, 'charset' => 'utf-8']]]]);
开发者ID:dotink,项目名称:inkwell-2.0,代码行数:5,代码来源:database.php

示例10:

<?php

namespace Dotink\Inkwell;

return Config::create(['Library'], ['class' => __NAMESPACE__ . '\\View', 'root_directory' => 'user/views', 'helper_directory' => 'library/helpers/view', 'extension_map' => [], 'cache_mode' => NULL, 'cache_directory' => 'assets/cache', 'asset_filters' => ['css' => [], 'js' => []]]);
开发者ID:dotink,项目名称:inkwell-2.0,代码行数:5,代码来源:view.php

示例11:

<?php

namespace Dotink\Inkwell;

return Config::create(['Core'], ['active_domain' => NULL, 'execution_mode' => 'development', 'write_directory' => 'writable', 'display_errors' => NULL, 'error_level' => E_ALL & ~E_STRICT, 'error_email_to' => NULL, 'cache' => ['type' => 'apc'], 'default_timezone' => 'America/Los_Angeles', 'date_formats' => ['console_date' => 'M jS, Y', 'console_time' => 'g:ia', 'console_timestamp' => 'M jS, Y @ g:ia'], 'aliases' => ['Core' => 'Dotink\\Flourish\\Core', 'Date' => 'Dotink\\Flourish\\Date', 'Directory' => 'Dotink\\Flourish\\Directory', 'File' => 'Dotink\\Flourish\\File', 'JSON' => 'Dotink\\Flourish\\JSON', 'Text' => 'Dotink\\Flourish\\Text', 'Time' => 'Dotink\\Flourish\\Time', 'Timestamp' => 'Dotink\\Flourish\\Timestamp', 'URL' => 'Dotink\\Flourish\\URL', 'UTF8' => 'Dotink\\Flourish\\UTF8']]);
开发者ID:dotink,项目名称:inkwell-2.0,代码行数:5,代码来源:inkwell.php

示例12:

<?php

namespace Dotink\Inkwell;

return Config::create(['Library'], ['auto_scaffold' => TRUE, 'root_directory' => 'external/testing/models']);
开发者ID:dotink,项目名称:inkwell-2.0,代码行数:5,代码来源:model.php

示例13: implode

<?php

namespace Dotink\Inkwell;

return Config::create(['Core'], ['types' => [], 'map' => ['default' => ['connection' => ['driver' => 'pdo_sqlite', 'dbname' => NULL, 'path' => implode(DIRECTORY_SEPARATOR, [__DIR__, '..', '..', 'external', 'testing', 'sample.db'])], 'types' => []]]]);
开发者ID:dotink,项目名称:inkwell-2.0,代码行数:5,代码来源:database.php

示例14:

<?php

namespace Dotink\Inkwell;

return Config::create(['Library'], ['class' => __NAMESPACE__ . '\\Model', 'auto_scaffold' => FALSE, 'auto_load' => TRUE, 'root_directory' => 'user/models']);
开发者ID:dotink,项目名称:inkwell-2.0,代码行数:5,代码来源:model.php

示例15:

<?php

namespace Dotink\Inkwell;

//
// Redirect maps take the following format:
//
// type = [
//      route => translation
// ]
//
// The route is defined exactly as it is in the routes configuration with a valid route
// pattern such as:
//
// /articles/[!:slug]
//
// The translation is similar, but does not require a pattern token.  All matching tokens from
// the route will be placed in the translation at the specified points:
//
// /blog/articles/[slug]
//
// Full Example:
//
// 301 => [
//     '/articles/[!:slug]' => '/blog/articles/[slug]'
// ]
//
// The above would redirect /articles/my_awesome_article to /blog/articles/my_awesome_article
//
return Config::create(['Core'], [HTTP\REDIRECT_PERMANENT => [], HTTP\REDIRECT_TEMPORARY => []]);
开发者ID:dotink,项目名称:inkwell-2.0,代码行数:30,代码来源:redirects.php


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