/** * Set config options (storage , lifetime , cleanupLimit) * @param array $options * @throws Exception */ public static function setOptions(array $options) { if (isset($options['storage'])) { if ($options['storage'] instanceof Store_Interface) { static::$_storage = $options['storage']; } else { throw new Exception('invalid storage'); } } if (isset($options['lifetime'])) { static::$_lifetime = intval($options['lifetime']); } if (isset($options['cleanupLimit'])) { static::$_cleanupLimit = intval($options['cleanupLimit']); } }
public static function getStorage() { if (static::$_storage === null) { static::$_storage = Storage::factory('ItemKOR', Config::get('path.itemkor')); } return static::$_storage; }
/** * Initializes the session class. * * @return void */ public static function __init() { static::$_storage = static::$_classes['session']; }
protected static function initStorage() { if (static::$_storage === false) { $config = ArrayHelper::getValue(Yii::$app->params, 'mdm.logger.storage'); if ($config === null || $config instanceof BaseStorage) { static::$_storage = $config; } else { static::$_storage = Yii::createObject($config); } } }