index.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * @author Open Mind
  4. * @date 09/04/2018
  5. * @time 11:33
  6. */
  7. //error_reporting(E_ALL);
  8. require 'vendor/autoload.php';
  9. $f3 = \Base::instance();
  10. $config = gzuncompress(base64_decode(file_get_contents("config.bin")));
  11. $f3->config('config.ini', true);
  12. $f3->config('labels.ini', true);
  13. // TODO: per testare le api
  14. //$CORE_SETTINGS = $f3->get('CORE.fb');
  15. //$findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
  16. //$label = new \SmartESL($findBoxCore, ['010714CE']);
  17. //$label->Display(1004, '4ML867738');
  18. $f3->set('DB',
  19. new \DB\SQL(
  20. $f3->get('DBSETTINGS'),
  21. $f3->get('dbuser'),
  22. $f3->get('dbpass'),
  23. array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_PERSISTENT => TRUE))
  24. );
  25. // Pages
  26. $f3->route('GET /', "Modules\Pages->Login", $f3->get('CACHE_TTL'));
  27. $f3->route('GET /homemenu', "Modules\Pages->HomeMenu", $f3->get('CACHE_TTL'));
  28. $f3->route('GET|POST /pick2light/@step', "Modules\Pages->Pick2Light", $f3->get('CACHE_TTL'));
  29. $f3->route("GET|POST /bind/@step", 'Modules\Pages->Bind', $f3->get('CACHE_TTL'));
  30. $f3->route('GET /elencodistinta', "Modules\Pages->ElencoDistinta", $f3->get('CACHE_TTL'));
  31. // Services
  32. $f3->route("POST /login", 'Modules\BaseController->Login');
  33. $f3->route("GET /logout", 'Modules\BaseController->Logout');
  34. $f3->run();