public function transformValues(array $values, VagrantBundle $vagrantBundle) { $map = ["mysql" => "php5-mysql", "mariadb" => "php5-mysql", "pgsql" => "php5-pgsql", "sqlite" => "php5-sqlite", "mongodb" => "php5-mongo"]; $playbook = $vagrantBundle->getPlaybook(); foreach ($map as $role => $package) { if ($playbook->hasRole($role)) { $values = $this->addPhpPackage($package, $values); } } return $values; }
/** * {@inheritdoc} */ public function setup(array $requestVars, VagrantBundle $vagrantBundle) { if (!$this->installRole($requestVars)) { return; } $playbook = $vagrantBundle->getPlaybook(); $roleMap = $this->getRolePackageMap(); foreach ($roleMap as $role => $package) { if ($playbook->hasRole($role)) { $this->addPhpPackage($package, $requestVars); } } parent::setup($requestVars, $vagrantBundle); }
/** * {@inheritdoc} */ public function setup(array $requestVars, VagrantBundle $vagrantBundle) { if (!array_key_exists($this->getSlug(), $requestVars)) { return; } if (!$this->installRole($requestVars)) { return; } $config = $requestVars[$this->getSlug()]; if (!is_null($this->role)) { $vagrantBundle->getPlaybook()->addRole($this->role); } $vagrantBundle->getVarsFile()->addMultipleVars([$this->getSlug() => $config]); }