config.inc 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. function define_($name, $value) {
  3. if(!defined($name)) {
  4. define($name, $value);
  5. }
  6. }
  7. if(file_exists(dirname(__FILE__) . "/localconfig.inc")) {
  8. include dirname(__FILE__) . "/localconfig.inc";
  9. }
  10. /*
  11. * Customizeable settings
  12. */
  13. define_("TEMPLATE_ROOT", "/var/www/templates/");
  14. define_("DB_HOST", "db-primary");
  15. define_("DB_USER", "root");
  16. define_("DB_PASS", "");
  17. define_("DB_DATABASE", "bifrost");
  18. define_("IMAGE_DOMAIN", "bifrost-images");
  19. /*
  20. * Composer vendor path
  21. */
  22. define_("COMPOSER_VENDOR_PATH", "/usr/local/code/3rdparty/");
  23. /*
  24. * Application settings. Do not edit!
  25. */
  26. define("APP_ROOT", dirname(__FILE__) . "/");
  27. define("LIB_ROOT", APP_ROOT . "libs/");
  28. define("VIEW_ROOT", APP_ROOT . "views/");
  29. define("LOGIC_ROOT", APP_ROOT . "business_logic/");
  30. define("DEVTOOL_ROOT", APP_ROOT . "editor/");
  31. function bifrost_autoload($class) {
  32. if(file_exists(LIB_ROOT . $class . ".inc")) {
  33. require_once (LIB_ROOT . $class . ".inc");
  34. }
  35. }
  36. function business_logic_autoload($class) {
  37. if(file_exists(LOGIC_ROOT . $class . ".inc")) {
  38. require_once (LOGIC_ROOT . $class . ".inc");
  39. }
  40. }
  41. spl_autoload_register("bifrost_autoload");
  42. spl_autoload_register("business_logic_autoload");
  43. require_once COMPOSER_VENDOR_PATH . 'vendor/autoload.php';