globals.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. // TODO: config all the global params
  3. $GLOBALS['charset'] = "utf8"; // utf8
  4. $GLOBALS['OS'] = "win32"; // win32 linux
  5. $GLOBALS['mem_engine'] = "predis"; // redis predis mem memd
  6. $GLOBALS['mem_version'] = "2.0"; // 2.0 3.0
  7. // TODO: config the game info
  8. define("GAME_VERSION", "1.0.0.0");
  9. define("GAME_NAME", "VPlan");
  10. define("GAME_ONLINE", false);
  11. define("GAME_PLAT", "main"); // main 360 baidu dcn mi uc ...... guest
  12. if (GAME_ONLINE) {
  13. // TODO: config the cdb set
  14. define("CDB_HOST", "127.0.0.1"); // 正式地址
  15. define("CDB_PORT", "3306");
  16. define("CDB_USER", "root");
  17. define("CDB_PASS", "wanggang1985");
  18. define("CDB_NAME", "ylsj2019_pay");
  19. // TODO: config the mem set
  20. define("MEM_HOST", "r-uf625aa34178bbf4.redis.rds.aliyuncs.com");
  21. define("MEM_PORT", 6379);
  22. define("MEM_PASS", "Redisvplan2017");
  23. define("MEM_DB", 0);
  24. } else {
  25. // TODO: config the cdb set
  26. define("CDB_HOST", "192.168.10.16");
  27. define("CDB_PORT", "3306");
  28. define("CDB_USER", "gwang");
  29. define("CDB_PASS", "wanggang1985");
  30. define("CDB_NAME", "ylsj2019_pay");
  31. // TODO: config the mem set
  32. define("MEM_HOST", "192.168.10.18");
  33. define("MEM_PORT", 6380);
  34. define("MEM_PASS", ""); // Redis
  35. define("MEM_DB", 0);
  36. }
  37. /**
  38. * 获取项目根路径(限制条件,本方法所在的文件也必须在项目根路径下wg)
  39. * @author gwang
  40. * @return string
  41. */
  42. function getRootURL() {
  43. $self = substr(__FILE__, strlen($_SERVER['DOCUMENT_ROOT']));
  44. $self = str_replace('\\', '/', $self);
  45. $uri = substr($self, 0, strrpos($self, '/') + 1);
  46. $url = "http://" . $_SERVER['HTTP_HOST'] . $uri;
  47. return $url;
  48. }
  49. define("ROOT_URL", getRootURL());