Commit 5f540724 authored by Jon Pugh's avatar Jon Pugh

Load db_server and platform context objects.

parent 37bd7d70
......@@ -2,6 +2,7 @@
namespace Aegir\Provision\Context;
use Aegir\Provision\Application;
use Aegir\Provision\Context;
use Symfony\Component\Config\Definition\ConfigurationInterface;
......@@ -19,6 +20,30 @@ class SiteContext extends Context implements ConfigurationInterface
*/
public $type = 'site';
/**
* PlatformContext constructor.
*
* @param $name
* @param $console_config
* @param Application $application
* @param array $options
*/
function __construct($name, $console_config, Application $application, array $options = [])
{
parent::__construct($name, $console_config, $application, $options);
// Load "db_server" context.
if (isset($this->config['db_server'])) {
$this->db_server = $application->getContext($this->config['service_subscriptions']['db']['server']);
$this->db_server->logger = $application->logger;
$this->platform = $application->getContext($this->config['platform']);
}
else {
throw new \Exception('No db_server found.');
}
}
static function option_documentation()
{
return [
......@@ -35,6 +60,17 @@ class SiteContext extends Context implements ConfigurationInterface
];
}
public function verify() {
parent::verify();
$this->db_server->verify();
$this->platform->verify();
// @TODO: Write VHOST!
return "Site Context Verified: " . $this->name;
}
// /**
// * Write out this named context to an alias file.
// */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment