/** * Magic method called when a class is first encountered by the Autoloader, * providing static initialization. * * @return void No value is returned */ public static function __initialize() { if (!\is_dir(STORAGE_PATH) and !\mkdir(STORAGE_PATH)) { throw new \RuntimeException('Could not create the STORAGE_PATH [' . STORAGE_PATH . '], please create this directory as a writable path in order to utilize the Datastore'); } static::$defaultDriver = Config::get('datastore.driver', 'file'); }
/** * Magic method called when a class is first encountered by the Autoloader, * providing static initialization. * * @return void No value is returned */ public static function __initialize() { if ((static::$key = Config::get('crypt.key')) == '') { throw new \Exception('The Crypt class cannot be used without providing a shared key. Please specify on in your crypt configuration file'); } static::$defaultDriver = Config::get('crypt.driver', 'xcrypt'); static::$hasher = Config::get('crypt.hasher', 'sha1'); static::$key = md5(static::$key); }
/** * Initialize the cache mechanizm */ protected static function init() { if (static::$drivers === null) { static::$drivers = array(); $config = Application::getConfig('cache'); $default = array_keys($config); if (!isset($default[0])) { throw new Exception('You\'re trying to use cache without any driver defined in cache config!'); } static::$defaultDriver = $default[0]; } }