index.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /** @package HELLO WORLD */
  3. set_include_path(
  4. './libs/' . PATH_SEPARATOR .
  5. './vendor/phreeze/phreeze/libs/' . PATH_SEPARATOR .
  6. get_include_path()
  7. );
  8. /* require framework libs */
  9. require_once 'verysimple/Phreeze/Dispatcher.php';
  10. require_once 'verysimple/Phreeze/ConnectionSetting.php';
  11. require_once 'verysimple/Phreeze/SimpleRouter.php';
  12. require_once 'verysimple/Phreeze/Phreezer.php';
  13. require_once 'Controller/TestController.php';
  14. $cs = new ConnectionSetting();
  15. $cs->ConnectionString = "localhost:3306";
  16. $cs->DBName = "hello_world";
  17. $cs->Username = "benchmarkdbuser";
  18. $cs->Password = "benchmarkdbpass";
  19. $cs->Type = "MySQL";
  20. $phreezer = new Phreezer($cs);
  21. $route_map = array(
  22. 'GET:' => array('route' => 'Test.JSON'),
  23. 'GET:json' => array('route' => 'Test.JSON'),
  24. 'GET:db' => array('route' => 'Test.DB'),
  25. 'GET:query' => array('route' => 'Test.Query'),
  26. 'GET:fortunes' => array('route' => 'Test.Fortunes'),
  27. 'GET:updates' => array('route' => 'Test.Updates'),
  28. 'GET:plaintext' => array('route' => 'Test.PlainText')
  29. );
  30. $router = new SimpleRouter('/','Test.JSON',$route_map);
  31. Dispatcher::$FAST_LOOKUP = true;
  32. Dispatcher::Dispatch(
  33. $phreezer,
  34. null,
  35. '',
  36. null,
  37. $router
  38. );