mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-08-28 10:08:56 +02:00
New reorder of classes and configuration. New instantiation of Tasks.
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
class Mage_Config
|
||||
{
|
||||
private $_environment = null;
|
||||
private $_scm = null;
|
||||
|
||||
public function loadEnvironment($environment)
|
||||
{
|
||||
$this->_environment = yaml_parse_file('.mage/config/environment/' . $environment . '.yaml');
|
||||
}
|
||||
|
||||
public function loadSCM()
|
||||
{
|
||||
$this->_scm = yaml_parse_file('.mage/config/scm.yaml');
|
||||
}
|
||||
|
||||
public function getEnvironment()
|
||||
{
|
||||
return $this->_environment;
|
||||
}
|
||||
|
||||
public function getSCM()
|
||||
{
|
||||
return $this->_scm;
|
||||
}
|
||||
|
||||
public function getHosts()
|
||||
{
|
||||
$config = $this->getEnvironment();
|
||||
return $config['hosts'];
|
||||
}
|
||||
|
||||
public function getTasks()
|
||||
{
|
||||
$config = $this->getEnvironment();
|
||||
return $config['tasks'];
|
||||
}
|
||||
|
||||
public function getConfig($host)
|
||||
{
|
||||
$taskConfig = array();
|
||||
$taskConfig['deploy'] = $this->getEnvironment();
|
||||
$taskConfig['deploy']['host'] = $host;
|
||||
$taskConfig['scm'] = $this->getSCM();
|
||||
|
||||
unset($taskConfig['deploy']['tasks']);
|
||||
unset($taskConfig['deploy']['hosts']);
|
||||
|
||||
return $taskConfig;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user