c::set PHP Method

set() static public method

Sets a config value by key
static public set ( string $key, mixed $value = null )
$key string The key to define
$value mixed The value for the passed key
    static function set($key, $value = null)
    {
        if (is_array($key)) {
            // set all new values
            self::$config = array_merge(self::$config, $key);
        } else {
            self::$config[$key] = $value;
        }
    }

Usage Example

コード例 #1
0
ファイル: panel.php プロジェクト: 04x10/04x10.com
 function __construct()
 {
     s::start();
     c::set('home.keepurl', true);
     // auto-detect the url if it is not set
     if (!c::get('url')) {
         c::set('url', c::get('scheme') . server::get('http_host'));
     }
     // setup the thumb plugin
     c::set('thumb.cache.root', c::get('root') . '/thumbs');
     c::set('thumb.cache.url', c::get('url') . '/thumbs');
     c::set('url', c::get('url') . '/' . c::get('panel.folder'));
     // remove the panel folder name from the uri
     c::set('subfolder', ltrim(c::get('subfolder') . '/' . c::get('panel.folder'), '/'));
     // attach the uri after caching
     $this->uri = new paneluri();
     if (c::get('lang.support')) {
         $path = $this->uri->path->toArray();
         $first = array_shift($path);
         if (!in_array($first, c::get('lang.available', array()))) {
             $first = c::get('lang.default');
         }
         // set the current language
         c::set('lang.current', $first);
         $this->uri->path = new uriPath($path);
     }
     // get the first set of pages
     $this->rootPages();
     // get the additional site info from content/site.txt
     $this->siteInfo();
 }
All Usage Examples Of c::set