|
|
|
@ -28,9 +28,7 @@ class Config {
@@ -28,9 +28,7 @@ class Config {
|
|
|
|
|
const LINE_READ_LIMIT = 500; |
|
|
|
|
const BYTE_READ_LIMIT = 450000000; |
|
|
|
|
const MODE = 1; |
|
|
|
|
// const API_BASE_URL = "https://geoserver.hcmr.gr/geoserver/rest/"; |
|
|
|
|
// const API_BASE_URL = getenv("https://geoserver.hcmr.gr/geoserver/rest/"); |
|
|
|
|
const API_CREDENTIALS = ["portal", "@dm!n322"]; |
|
|
|
|
/* const REPO_API = "http://msfd-repo.ath.hcmr.gr"; */ |
|
|
|
|
const API_URL = array( |
|
|
|
|
"REPO" => "http://msfd-repo.ath.hcmr.gr/", |
|
|
|
@ -41,13 +39,7 @@ class Config {
@@ -41,13 +39,7 @@ class Config {
|
|
|
|
|
|
|
|
|
|
// Database configuration |
|
|
|
|
// Production / Development |
|
|
|
|
const API_CREDS = array( |
|
|
|
|
"REPO" => "", |
|
|
|
|
"GSRV" => "", |
|
|
|
|
"POSD" => "", |
|
|
|
|
"WFD" => "" |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
private static $api_creds; |
|
|
|
|
// Header translations |
|
|
|
|
const HEADER_TRANSLATIONS = [ |
|
|
|
|
'Cruise' => 'cruise', |
|
|
|
@ -91,6 +83,11 @@ class Config {
@@ -91,6 +83,11 @@ class Config {
|
|
|
|
|
return self::ITEM_SEPARATOR; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static function getAPIBaseURL($api_name) |
|
|
|
|
{ |
|
|
|
|
$url = getenv("{$api_name}_URL"); |
|
|
|
|
return self::API_URL[$api_name]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static function getDatabaseCreds($mode = self::MODE) |
|
|
|
|
{ |
|
|
|
@ -111,7 +108,22 @@ class Config {
@@ -111,7 +108,22 @@ class Config {
|
|
|
|
|
|
|
|
|
|
public static function getAPICredentials($api_name) |
|
|
|
|
{ |
|
|
|
|
return self::API_CREDENTIALS; |
|
|
|
|
$username = getenv("{$api_name}_USER"); |
|
|
|
|
$password = getenv("{$api_name}_PASS"); |
|
|
|
|
|
|
|
|
|
return array("username" => $username, "password" => $password); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// public static function getAPICredentials($api_name) |
|
|
|
|
// { |
|
|
|
|
// self::$api_creds = array( |
|
|
|
|
// "REPO" => getenv("CREDS_REPO"), |
|
|
|
|
// "GSRV" => getenv("CREDS_GSRV"), |
|
|
|
|
// "POSD" => getenv("CREDS_POSD"), |
|
|
|
|
// "WFD" => getenv("CREDS_WFD") |
|
|
|
|
// ); |
|
|
|
|
// |
|
|
|
|
// return self::$api_creds[$api_name]; |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|