Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //bootstrap class
- public static function prepare()
- {
- self::setupEnvironment();
- Zend_Loader::registerAutoload();
- self::setupRegistry();
- Zend_Session::start();
- self::setupConfiguration();
- //cache here
- self::setupCache();
- self::$cache->start();
- //....
- }
- public static function setupCache()
- {
- $frontendOptions = array(
- 'lifetime' => 20,
- 'debug_header' => true, // for debugging
- 'regexps' => array(
- // cache ALL the urls
- '(.*)' => array('cache' => true, 'cache_with_get_variables' => true)
- )
- );
- $backendOptions = array(
- 'cache_dir' => APP_PATH . '/cache/ZendCache/', // Directory where to put the cache files
- 'file_name_prefix' => 'zend_cache_query',
- 'hashed_directory_level' => 2
- );
- // getting a Zend_Cache_Core object
- self::$cache = Zend_Cache::factory('Page',
- 'File',
- $frontendOptions,
- $backendOptions);
- }
Add Comment
Please, Sign In to add comment