12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- // TODO: config all the global params
- $GLOBALS['charset'] = "utf8"; // utf8
- $GLOBALS['OS'] = "win32"; // win32 linux
- $GLOBALS['mem_engine'] = "predis"; // redis predis mem memd
- $GLOBALS['mem_version'] = "2.0"; // 2.0 3.0
- // TODO: config the game info
- define("GAME_VERSION", "1.0.0.0");
- define("GAME_NAME", "VPlan");
- define("GAME_ONLINE", false);
- define("GAME_PLAT", "main"); // main 360 baidu dcn mi uc ...... guest
- if (GAME_ONLINE) {
- // TODO: config the cdb set
- define("CDB_HOST", "127.0.0.1"); // 正式地址
- define("CDB_PORT", "3306");
- define("CDB_USER", "root");
- define("CDB_PASS", "wanggang1985");
- define("CDB_NAME", "ylsj2019_pay");
- // TODO: config the mem set
- define("MEM_HOST", "r-uf625aa34178bbf4.redis.rds.aliyuncs.com");
- define("MEM_PORT", 6379);
- define("MEM_PASS", "Redisvplan2017");
- define("MEM_DB", 0);
- } else {
- // TODO: config the cdb set
- define("CDB_HOST", "192.168.10.16");
- define("CDB_PORT", "3306");
- define("CDB_USER", "gwang");
- define("CDB_PASS", "wanggang1985");
- define("CDB_NAME", "ylsj2019_pay");
- // TODO: config the mem set
- define("MEM_HOST", "192.168.10.18");
- define("MEM_PORT", 6380);
- define("MEM_PASS", ""); // Redis
- define("MEM_DB", 0);
- }
- /**
- * 获取项目根路径(限制条件,本方法所在的文件也必须在项目根路径下wg)
- * @author gwang
- * @return string
- */
- function getRootURL() {
- $self = substr(__FILE__, strlen($_SERVER['DOCUMENT_ROOT']));
- $self = str_replace('\\', '/', $self);
- $uri = substr($self, 0, strrpos($self, '/') + 1);
- $url = "http://" . $_SERVER['HTTP_HOST'] . $uri;
- return $url;
- }
- define("ROOT_URL", getRootURL());
|