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); } }
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); } }
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); } }
public static function getConfig() { return array('mch_id' => Kernel::getConfig('mchId'), 'appid' => Kernel::getConfig('appId'), 'key' => Kernel::getConfig('apiSecret')); }