|
|
@ -28,9 +28,7 @@ class Config { |
|
|
|
const LINE_READ_LIMIT = 500; |
|
|
|
const LINE_READ_LIMIT = 500; |
|
|
|
const BYTE_READ_LIMIT = 450000000; |
|
|
|
const BYTE_READ_LIMIT = 450000000; |
|
|
|
const MODE = 1; |
|
|
|
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_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 REPO_API = "http://msfd-repo.ath.hcmr.gr"; */ |
|
|
|
const API_URL = array( |
|
|
|
const API_URL = array( |
|
|
|
"REPO" => "http://msfd-repo.ath.hcmr.gr/", |
|
|
|
"REPO" => "http://msfd-repo.ath.hcmr.gr/", |
|
|
@ -41,13 +39,7 @@ class Config { |
|
|
|
|
|
|
|
|
|
|
|
// Database configuration |
|
|
|
// Database configuration |
|
|
|
// Production / Development |
|
|
|
// Production / Development |
|
|
|
const API_CREDS = array( |
|
|
|
private static $api_creds; |
|
|
|
"REPO" => "", |
|
|
|
|
|
|
|
"GSRV" => "", |
|
|
|
|
|
|
|
"POSD" => "", |
|
|
|
|
|
|
|
"WFD" => "" |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Header translations |
|
|
|
// Header translations |
|
|
|
const HEADER_TRANSLATIONS = [ |
|
|
|
const HEADER_TRANSLATIONS = [ |
|
|
|
'Cruise' => 'cruise', |
|
|
|
'Cruise' => 'cruise', |
|
|
@ -91,6 +83,11 @@ class Config { |
|
|
|
return self::ITEM_SEPARATOR; |
|
|
|
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) |
|
|
|
public static function getDatabaseCreds($mode = self::MODE) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -111,7 +108,22 @@ class Config { |
|
|
|
|
|
|
|
|
|
|
|
public static function getAPICredentials($api_name) |
|
|
|
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]; |
|
|
|
|
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|