2019-08-18 16:52:23 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
/**
|
|
|
|
* Application configuration
|
|
|
|
*
|
|
|
|
* PHP version 7.0
|
|
|
|
*/
|
|
|
|
class Config
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Database host
|
|
|
|
* @var string
|
|
|
|
*/
|
2023-07-29 01:37:53 +00:00
|
|
|
const DB_HOST = '117.50.187.222';
|
2019-08-18 16:52:23 +00:00
|
|
|
/**
|
|
|
|
* Database name
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
const DB_NAME = 'background';
|
2019-09-16 16:09:38 +00:00
|
|
|
const ROUTE_PREFIX_DEV = "/api/public/";
|
2019-08-31 15:43:37 +00:00
|
|
|
const ROUTE_PREFIX = "/wapi/";
|
2019-08-18 16:52:23 +00:00
|
|
|
/**
|
|
|
|
* Database user
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
const DB_USER = 'caiyu';
|
|
|
|
/**
|
|
|
|
* Database password
|
|
|
|
* @var string
|
|
|
|
*/
|
2023-07-29 01:37:53 +00:00
|
|
|
const DB_PASSWORD = 'zhengcaiyu123';
|
2019-08-18 16:52:23 +00:00
|
|
|
/**
|
|
|
|
* Show or hide error messages on screen
|
|
|
|
* @var boolean
|
|
|
|
*/
|
|
|
|
const SHOW_ERRORS = true;
|
2019-10-01 13:40:21 +00:00
|
|
|
static public $DEBUG = false;
|
2020-05-12 05:17:28 +00:00
|
|
|
|
2020-07-11 18:16:35 +00:00
|
|
|
const ARTICLE_URL = "/api/public/Blog/article";
|
2020-05-12 05:17:28 +00:00
|
|
|
static public function Url(){
|
|
|
|
if (true == Config::$DEBUG){
|
2020-07-31 16:56:57 +00:00
|
|
|
return "/api/public/";
|
2020-05-12 05:17:28 +00:00
|
|
|
}else{
|
2020-08-01 09:02:05 +00:00
|
|
|
return "/wapi/";
|
2020-05-12 05:17:28 +00:00
|
|
|
}
|
|
|
|
}
|
2021-03-01 04:02:49 +00:00
|
|
|
static public function DBUrl() {
|
|
|
|
if ( "0.0.0.0" == $_SERVER['SERVER_NAME']){
|
2022-01-26 14:47:34 +00:00
|
|
|
return "117.50.176.114";
|
2021-03-01 04:02:49 +00:00
|
|
|
}
|
|
|
|
if("testingcloud.club" == $_SERVER['SERVER_NAME']){
|
|
|
|
return "127.0.0.1";
|
|
|
|
}
|
2022-01-26 14:47:34 +00:00
|
|
|
}
|
2021-01-11 15:42:21 +00:00
|
|
|
static public function ServerUrl() {
|
2020-07-19 16:54:28 +00:00
|
|
|
if ( "0.0.0.0" == $_SERVER['SERVER_NAME']){
|
|
|
|
return "http://127.0.0.1/api/public/";
|
|
|
|
}
|
|
|
|
if("testingcloud.club" == $_SERVER['SERVER_NAME']){
|
|
|
|
return "https://www.testingcloud.club/wapi/";
|
|
|
|
}
|
2022-01-26 14:47:34 +00:00
|
|
|
if("" == $_SERVER['SERVER_NAME']){
|
|
|
|
return "https://www.testingcloud.club/wapi/";
|
|
|
|
}
|
2020-07-19 16:54:28 +00:00
|
|
|
}
|
2021-02-28 10:02:23 +00:00
|
|
|
static public function OpenApiUrl() {
|
|
|
|
if ( "0.0.0.0" == $_SERVER['SERVER_NAME']){
|
2022-01-26 14:47:34 +00:00
|
|
|
return "http://127.0.0.1:4596";
|
2021-02-28 10:02:23 +00:00
|
|
|
}
|
|
|
|
if("testingcloud.club" == $_SERVER['SERVER_NAME']){
|
|
|
|
return "https://www.testingcloud.club/sapi/";
|
|
|
|
}
|
2022-01-26 14:47:34 +00:00
|
|
|
return "https://www.testingcloud.club/sapi/";
|
|
|
|
|
2021-02-28 10:02:23 +00:00
|
|
|
}
|
2023-05-05 15:54:51 +00:00
|
|
|
static public function RedisServer() {
|
|
|
|
if("localhost" == $_SERVER['SERVER_NAME']){
|
2023-07-27 03:24:30 +00:00
|
|
|
return "127.0.0.1";
|
2023-05-05 15:54:51 +00:00
|
|
|
}
|
|
|
|
if ( "0.0.0.0" == $_SERVER['SERVER_NAME']){
|
|
|
|
return "192.168.0.200";
|
|
|
|
}
|
|
|
|
if("testingcloud.club" == $_SERVER['SERVER_NAME']){
|
|
|
|
return "127.0.0.1";
|
|
|
|
}
|
2023-07-24 16:35:31 +00:00
|
|
|
return "127.0.0.1";
|
2023-05-05 15:54:51 +00:00
|
|
|
}
|
2022-01-26 14:47:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|