Skip to content

Commit

Permalink
Add "replace" entries.
Browse files Browse the repository at this point in the history
So we can use packages from a current Git checkout as a stand-in for released PEAR packages.
  • Loading branch information
yunosh committed Apr 20, 2017
1 parent c0e0006 commit d3138ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/lib/Conductor/Package2XmlToComposer.php
Expand Up @@ -528,7 +528,6 @@ public function convert($output_file = null)
}

// assemble human-readable composer.json
$tab = ' ';
$j = new stdClass();
$j->name = $this->name;

Expand Down Expand Up @@ -635,6 +634,10 @@ public function convert($output_file = null)
}
}

$replaceVersion = preg_replace('/^(\d+)\..*/', '$1.*', $j->version);
$j->replace = new stdClass();
$j->replace->{'pear-' . $this->data['channel'] . '/' . $this->data['name']} = $replaceVersion;
$j->replace->{'pear-' . $this->getChannelSuggestedAlias($this->data['channel']) . '/' . $this->data['name']} = $replaceVersion;

if (! empty($this->bin_files)) {
$j->bin = array();
Expand Down

0 comments on commit d3138ad

Please sign in to comment.