config.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <?php
  2. /**
  3. * Configuration variables.
  4. *
  5. * Not meant to be edited by the user.
  6. *
  7. * @category Data
  8. */
  9. /**
  10. * Define constant and includesome helpers.
  11. */
  12. define('BASE_PATH', $_SERVER["DOCUMENT_ROOT"] . "/");
  13. require_once(__DIR__ . "/helper/NET_Helper.php");
  14. define('BASE_URL', NET::get_protocol() . $_SERVER["HTTP_HOST"] . "/");
  15. /**
  16. * App related constants.
  17. *
  18. * @category Data
  19. */
  20. final class APP{
  21. /**
  22. * App version.
  23. *
  24. * Can be any string, not just numbers.
  25. */
  26. const VERSION = "2";
  27. }
  28. /**
  29. * In-app URLs.
  30. *
  31. * @category Data
  32. */
  33. final class URL{
  34. /**
  35. * Domain, with protcol (includes final '/').
  36. */
  37. const BASE = BASE_URL;
  38. /**
  39. * Fonts full url (includes final '/').
  40. */
  41. const FONTS = BASE_URL . "/fonts/";
  42. /**
  43. * CSS full url (includes final '/').
  44. */
  45. const CSS = BASE_URL . "/css/";
  46. /**
  47. * URLs to image resources.
  48. */
  49. const IMG = array(
  50. "BASE" => BASE_URL . "img/",
  51. "UNKNOWN" => BASE_URL . "img/unknown.png",
  52. "ICON" => BASE_URL . "img/icon/",
  53. "LOGO" => BASE_URL . "img/logo/",
  54. "CURRENCY" => BASE_URL . "img/currency/",
  55. "UNIT" => BASE_URL . "img/unit/",
  56. "AREA" => BASE_URL . "img/area/",
  57. "SKILL" => BASE_URL . "img/skill/",
  58. "ESSENCE" => BASE_URL . "img/essence/",
  59. "RUNE" => BASE_URL . "img/rune/",
  60. "GRIND" => BASE_URL . "img/grind/",
  61. "ELEMENT" => BASE_URL . "img/element/",
  62. "SKILL_GUILD" => BASE_URL . "img/skill_guild/",
  63. "DECORATION" => BASE_URL . "img/decoration/",
  64. "SOURCE" => BASE_URL . "img/source/",
  65. "SKILL_LEADER" => BASE_URL . "img/skill_leader/",
  66. "INVENTORY" => BASE_URL . "img/inventory/",
  67. "EFFECT" => BASE_URL . "img/effect/",
  68. "BUILDING" => BASE_URL . "img/building/",
  69. );
  70. }
  71. /**
  72. * In-app directories (filesystem, not url).
  73. *
  74. * @category Data
  75. */
  76. final class PATH{
  77. /**
  78. * Path to the application direcory.
  79. */
  80. const APPLICATION = BASE_PATH . "../application/";
  81. /**
  82. * Path to the public direcory.
  83. */
  84. const BASE = BASE_PATH;
  85. /**
  86. * Path to the controller file.
  87. */
  88. const CONTROLLER = BASE_PATH . "../application/Controller.php";
  89. /**
  90. * Path to the entity files.
  91. */
  92. const ENTITY = BASE_PATH . "../application/entity/";
  93. /**
  94. * Path to the page files.
  95. */
  96. const PAGE = BASE_PATH . "../application/page/";
  97. /**
  98. * Path to the action files.
  99. */
  100. const ACTION = BASE_PATH . "../application/action/";
  101. /**
  102. * Path to the view files.
  103. */
  104. const VIEW = BASE_PATH . "../application/view/";
  105. /**
  106. * Paths to image resources.
  107. */
  108. const IMG = array(
  109. "BASE" => BASE_PATH . "img/",
  110. "UNKNOWN" => BASE_PATH . "img/unknown.png",
  111. "ICON" => BASE_PATH . "img/icon/",
  112. "LOGO" => BASE_PATH . "img/logo/",
  113. "CURRENCY" => BASE_PATH . "img/currency/",
  114. "UNIT" => BASE_PATH . "img/unit/",
  115. "AREA" => BASE_PATH . "img/area/",
  116. "SKILL" => BASE_PATH . "img/skill/",
  117. "ESSENCE" => BASE_PATH . "img/essence/",
  118. "RUNE" => BASE_PATH . "img/rune/",
  119. "GRIND" => BASE_PATH . "img/grind/",
  120. "ELEMENT" => BASE_PATH . "img/element/",
  121. "SKILL_GUILD" => BASE_PATH . "img/skill_guild/",
  122. "DECORATION" => BASE_PATH . "img/decoration/",
  123. "SOURCE" => BASE_PATH . "img/source/",
  124. "SKILL_LEADER" => BASE_PATH . "img/skill_leader/",
  125. "INVENTORY" => BASE_PATH . "img/inventory/",
  126. "EFFECT" => BASE_PATH . "img/effect/",
  127. "BUILDING" => BASE_PATH . "img/building/",
  128. );
  129. /**
  130. * Path to the helper files.
  131. */
  132. const HELPER = BASE_PATH . "../application/helper/";
  133. /**
  134. * Path to the db_key files.
  135. */
  136. const DB_KEY = BASE_PATH . "../application/sw.sqlite";
  137. /**
  138. * Path to the db_data files.
  139. */
  140. const DB_DATA = BASE_PATH . "../data/sw.sqlite";
  141. }
  142. ?>