config.php 4.2 KB

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