當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。