57 lines
1.2 KiB
PHP
57 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App;
|
|
/**
|
|
* Application configuration
|
|
*
|
|
* PHP version 7.0
|
|
*/
|
|
class Config
|
|
{
|
|
/**
|
|
* Database host
|
|
* @var string
|
|
*/
|
|
const DB_HOST = '49.235.25.67';
|
|
/**
|
|
* Database name
|
|
* @var string
|
|
*/
|
|
const DB_NAME = 'background';
|
|
const ROUTE_PREFIX_DEV = "/api/public/";
|
|
const ROUTE_PREFIX = "/wapi/";
|
|
/**
|
|
* Database user
|
|
* @var string
|
|
*/
|
|
const DB_USER = 'caiyu';
|
|
/**
|
|
* Database password
|
|
* @var string
|
|
*/
|
|
const DB_PASSWORD = '12345678';
|
|
/**
|
|
* Show or hide error messages on screen
|
|
* @var boolean
|
|
*/
|
|
const SHOW_ERRORS = true;
|
|
static public $DEBUG = false;
|
|
|
|
const ARTICLE_URL = "/api/public/Blog/article";
|
|
|
|
static public function Url(){
|
|
if (true == Config::$DEBUG){
|
|
return "/api/public/";
|
|
}else{
|
|
return "/wapi/";
|
|
}
|
|
}
|
|
static public function ServerUrl() {
|
|
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/";
|
|
}
|
|
}
|
|
} |