Guest User

Untitled

a guest
Jun 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. //bootstrap class
  2.  
  3. public static function prepare()
  4. {
  5. self::setupEnvironment();
  6. Zend_Loader::registerAutoload();
  7. self::setupRegistry();
  8. Zend_Session::start();
  9.  
  10.  
  11. self::setupConfiguration();
  12.  
  13. //cache here
  14. self::setupCache();
  15. self::$cache->start();
  16. //....
  17. }
  18.  
  19.  
  20. public static function setupCache()
  21. {
  22.  
  23. $frontendOptions = array(
  24. 'lifetime' => 20,
  25. 'debug_header' => true, // for debugging
  26. 'regexps' => array(
  27. // cache ALL the urls
  28. '(.*)' => array('cache' => true, 'cache_with_get_variables' => true)
  29. )
  30. );
  31.  
  32. $backendOptions = array(
  33. 'cache_dir' => APP_PATH . '/cache/ZendCache/', // Directory where to put the cache files
  34. 'file_name_prefix' => 'zend_cache_query',
  35. 'hashed_directory_level' => 2
  36. );
  37.  
  38. // getting a Zend_Cache_Core object
  39. self::$cache = Zend_Cache::factory('Page',
  40. 'File',
  41. $frontendOptions,
  42. $backendOptions);
  43. }
Add Comment
Please, Sign In to add comment