Skip to content

Commit 48bdce1

Browse files
committed
Merges minimum required data with submitted before creating archive file
1 parent e0f56d8 commit 48bdce1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Puphpet/MainBundle/Extension/Manager.php

+15
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ public function getExtensionAvailableData($name)
9898
*/
9999
public function createArchive(array $data)
100100
{
101+
foreach ($data as $key => $values) {
102+
$name = $this->parseDataKeyName($values, $key);
103+
104+
$data[$key] = array_replace_recursive($this->extensions[$name]['data'], $data[$key]);
105+
}
106+
101107
$this->archive = new Extension\Archive;
102108
$this->archive->queueToFile(
103109
'puphpet/config.yaml',
@@ -185,6 +191,15 @@ protected function vagrantfileHandling($data, $name)
185191
return $name;
186192
}
187193

194+
protected function parseDataKeyName($data, $name)
195+
{
196+
if (stristr($name, 'vagrantfile') !== false) {
197+
return sprintf('vagrantfile_%s', $data['target']);
198+
}
199+
200+
return $name;
201+
}
202+
188203
protected function yamlParse($file)
189204
{
190205
return Yaml::parse($file, true);

0 commit comments

Comments
 (0)