Skip to content

Commit

Permalink
added ability to specify non default custom project order
Browse files Browse the repository at this point in the history
  • Loading branch information
janschumann committed Mar 18, 2015
1 parent 43e6697 commit b62f435
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public function getConfigTreeBuilder() {
$rootNode
->fixXmlConfig('drushExtension')
->children()
->scalarNode('order')->defaultValue('')->end()
->arrayNode('variable')
->prototype('array')
->children()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public function load(array $configs, ContainerBuilder $container)
$this->buildProject($container, $typeName, $projectName, $project);
}
}

if (isset($config['order']) && !empty($config['order'])) {
$order = explode(',', str_replace(' ', '', $config['order']));
$container->getDefinition('mc.composer')->addMethodCall('setOrder', array($order));
}
}

private function buildProject(ContainerBuilder $container, $type, $projectName, $project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<xsd:element name="customProjects" type="customProjects" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="variable" type="variable" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="order" default="composer,dev,custom" use="optional" />
</xsd:complexType>


Expand Down
2 changes: 1 addition & 1 deletion src/Drupal/ModuleComposer/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private function getProjectsBySubType($projects) {
* @param array $order
*/
public function setOrder(array $order) {
$this->order = $order;
$this->customProjectsTypeOrder = $order;
}

/**
Expand Down

0 comments on commit b62f435

Please sign in to comment.