Skip to content

Commit

Permalink
add getStaging to Application
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielsolomon committed Aug 23, 2016
1 parent da1de03 commit 4555f88
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class Application
protected $_container = null;

protected $_request = null;

protected $_staging;

/**
* @var null|LoggerManager
*/
Expand All @@ -32,6 +29,11 @@ class Application

protected $_debugBar = null;

/**
* @var Staging
*/
protected $_staging;

/**
* @var Stage
*/
Expand Down Expand Up @@ -77,24 +79,44 @@ public function setupConfig()

public function setupStaging()
{
$this->_staging = $this->initStaging();

$this->_stage = $this->_staging->getStage();
$this->getFrontController()->setStaging($this->getStaging());
$this->getFrontController()->setStage($this->getStage());
}

$this->getFrontController()->setStaging($this->_staging);
$this->getFrontController()->setStage($this->_stage);
/**
* @return Staging
*/
public function getStaging()
{
if ($this->_staging == null) {
$this->initStaging();
}
return $this->_staging;
}

public function initStaging()
{
$this->_staging = $this->newStaging();
}

public function newStaging()
{
return Staging::instance();
}

public function getStage()
{
if ($this->_staging == null) {
$this->initStage();
}
return $this->_stage;
}

public function initStage()
{
$this->_stage = $this->getStaging()->getStage();
}

public function getAutoloader()
{
if ($this->_autoloader == null) {
Expand Down

0 comments on commit 4555f88

Please sign in to comment.