bootstrap.php 890 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use Ubiquity\devtools\cmd\ConsoleFormatter as Console;
  3. use Ubiquity\cache\CacheManager;
  4. //Comments
  5. //For development mode initialization
  6. function _dev($devtools, $config)
  7. {
  8. echo Console::showInfo("Development mode");
  9. }
  10. //For Production mode initialization
  11. //Create and store dynamic routes.
  12. function _prod($devtools, $config)
  13. {
  14. echo Console::showInfo("Production mode for benchmark");
  15. CacheManager::start($config);
  16. CacheManager::clearCache($config);
  17. include ROOT.DS.'config'.DS.'microApp.php';
  18. CacheManager::storeDynamicRoutes(false);
  19. echo Console::showMessage('Dynamic routes created!', 'success');
  20. $devtools->run('composer', 'optimize');
  21. }
  22. //Executed before all modes
  23. function bs_before($devtools, $config)
  24. {
  25. }
  26. //Executed after all modes
  27. function bs_after($devtools, $config)
  28. {
  29. //Initialize all caches
  30. //$devtools->run('init-cache');
  31. }