示例#1
0
 /**
  * Create a controller instance in the environment if none has been defined yet.
  *
  * @param EnvironmentInterface $environment The environment to populate.
  *
  * @return void
  *
  * @internal
  */
 public function populateController(EnvironmentInterface $environment)
 {
     // Already populated, get out then.
     if ($environment->getController()) {
         return;
     }
     $controller = new DefaultController();
     $controller->setEnvironment($environment);
     $environment->setController($controller);
 }
示例#2
0
 /**
  * Create the environment.
  *
  * @return void
  */
 private function createEnvironment()
 {
     $container = new DefaultContainer('workflow_data');
     $container->setPropertiesDefinition(new DefaultPropertiesDefinition());
     $container->setBasicDefinition(new DefaultBasicDefinition());
     $this->environment = new DefaultEnvironment();
     $this->environment->setDataDefinition($container);
     $this->environment->setInputProvider(new InputProvider());
     $controller = new DefaultController();
     $controller->setEnvironment($this->environment);
     $this->environment->setController($controller);
 }