index.php 1.0 KB

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