2019-08-18 16:52:23 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App;
|
|
|
|
/**
|
|
|
|
* Application configuration
|
|
|
|
*
|
|
|
|
* PHP version 7.0
|
|
|
|
*/
|
|
|
|
class Config
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Database host
|
|
|
|
* @var string
|
|
|
|
*/
|
2020-02-23 07:15:24 +00:00
|
|
|
const DB_HOST = '49.235.25.67';
|
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
|
|
|
|
*/
|
2020-02-23 07:15:24 +00:00
|
|
|
const DB_PASSWORD = '12345678';
|
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-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/";
|
|
|
|
}
|
|
|
|
}
|
2020-07-28 14:19:23 +00:00
|
|
|
}
|