Skip to content
This repository was archived by the owner on Dec 21, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion packager.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ private function parse_manifest($path){

foreach ($manifest['sources'] as $i => $path){

// thomasd: if the source-node contains a description we cache it, but we wait if there's also a description-header in the file as this one takes precedence
if(is_array($path)){
$source_desc = $path[1];
$path = $path[0];
}
$path = $package_path . $path;

// this is where we "hook" for possible other replacers.
Expand All @@ -71,7 +76,13 @@ private function parse_manifest($path){
// get contents of first comment
preg_match('/\/\*\s*^---(.*?)^\.\.\.\s*\*\//ms', $source, $matches);

if (!empty($matches)) $descriptor = YAML::decode($matches[0]);
if (!empty($matches)){
$descriptor = YAML::decode($matches[0]);
}
// thomasd: if the file doesn't contain a proper description-header but the manifest does, we take that description
else if(isset($source_desc) && is_array($source_desc)){
$descriptor = $source_desc;
}

// populate / convert to array requires and provides
$requires = (array)(!empty($descriptor['requires']) ? $descriptor['requires'] : array());
Expand Down