mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-08 14:28:57 +02:00
New config settings.
This commit is contained in:
@@ -3,6 +3,7 @@ class Mage_Config
|
||||
{
|
||||
private $_environment = null;
|
||||
private $_scm = null;
|
||||
private $_general = null;
|
||||
private $_host = null;
|
||||
private $_releaseId = null;
|
||||
|
||||
@@ -20,6 +21,13 @@ class Mage_Config
|
||||
}
|
||||
}
|
||||
|
||||
public function loadGeneral()
|
||||
{
|
||||
if (file_exists('.mage/config/general.yaml')) {
|
||||
$this->_general = @yaml_parse_file('.mage/config/general.yaml');
|
||||
}
|
||||
}
|
||||
|
||||
public function getEnvironment()
|
||||
{
|
||||
return $this->_environment;
|
||||
@@ -30,6 +38,11 @@ class Mage_Config
|
||||
return $this->_scm;
|
||||
}
|
||||
|
||||
public function getGlobal()
|
||||
{
|
||||
return $this->_global;
|
||||
}
|
||||
|
||||
public function getHosts()
|
||||
{
|
||||
$config = $this->getEnvironment();
|
||||
@@ -141,4 +154,24 @@ class Mage_Config
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
|
||||
public function general($option, $default = false)
|
||||
{
|
||||
$options = $this->_general;
|
||||
if (isset($options[$option])) {
|
||||
return $options[$option];
|
||||
} else {
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
|
||||
public function mail($option, $default = false)
|
||||
{
|
||||
$options = $this->_general;
|
||||
if (isset($options['mail'][$option])) {
|
||||
return $options['mail'][$option];
|
||||
} else {
|
||||
return $default;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user