index.php 570 B

1234567891011121314151617181920212223
  1. <?php
  2. //get environment variables
  3. $db_user = getenv('EV_php_user');
  4. $db_pass = getenv('EV_php_pass');
  5. $db_name = getenv('EV_php_name');
  6. $db_host = getenv('EV_php_host');
  7. $db_init = "mysql:host={$db_host};dbname={$db_name};charset=utf8";
  8. $db = new PDO($db_init, $db_user, $db_pass);
  9. //set some db attributes
  10. $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
  11. $db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
  12. $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  13. if (true) {
  14. //add backends here
  15. require_once 'backend/users/index.php';
  16. }
  17. ?>