getConfig() public static method

public static getConfig ( $name, $defaultValue = null )
Example #1
0
 public static function init()
 {
     if (empty(self::$cache)) {
         $config = Kernel::getConfig('cache', array('class' => 'PFinal\\Cache\\FileCache', 'keyPrefix' => 'pfinal.wechat'));
         $class = $config['class'];
         unset($config['class']);
         self::$cache = new $class($config);
     }
 }
Example #2
0
 protected static function init()
 {
     if (static::$session === null) {
         $config = Kernel::getConfig('session', array('class' => 'PFinal\\Session\\NativeSession', 'keyPrefix' => 'pfinal.wechat'));
         $class = $config['class'];
         unset($config['class']);
         static::$session = new $class($config);
     }
 }
Example #3
0
 private static function init()
 {
     if (static::$logger === null) {
         $config = Kernel::getConfig('log', array('class' => 'PFinal\\Wechat\\Support\\Logger'));
         $class = $config['class'];
         unset($config['class']);
         static::$logger = new $class($config);
     }
 }
Example #4
0
 public static function getConfig()
 {
     return array('mch_id' => Kernel::getConfig('mchId'), 'appid' => Kernel::getConfig('appId'), 'key' => Kernel::getConfig('apiSecret'));
 }