config.php 4.1 KB

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