From 1898278b453784322592f17ed6487ae6de5a7590 Mon Sep 17 00:00:00 2001 From: Thomas Birke Date: Wed, 18 Jun 2014 14:40:59 +0200 Subject: [PATCH] Include package dependency contents --- README.md | 9 +++++++++ src/shell/packager.php | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index 91a4dff..7f98560 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,12 @@ Example "type":"mage", "structure":"file", "path":"just a random file path" + }, + { + "type":"magelib", + "structure":"dir", + "path":"SomeNamespace", + "from":"vendor/foo/bar/src/SomeNamespace" } ] } @@ -138,6 +144,9 @@ It is very similar to modman but you need to tell magento the type, if it is a f `path` is the path to your source files. +If you want to include an external library in your package, but on your machine it's located in another path (because +it is a dependency installed via composer), you may specify the real path `from`. + History ======= This script was developed first within [https://github.com/Flagbit/Magento-FilterUrls]. diff --git a/src/shell/packager.php b/src/shell/packager.php index 0e368f4..c90db48 100644 --- a/src/shell/packager.php +++ b/src/shell/packager.php @@ -191,6 +191,14 @@ public function getContent() $ignore = $element->ignore; } + if(isset($element->from)) { + $mageTargets = new Mage_Connect_Package_Target(); + $targetMap = $mageTargets->getTargets(); + + $link = BP . DS . $targetMap[$element->type] . DS . $element->path; + symlink(BP . DS . $element->from, $link); + } + $contents["target"][$i] = $element->type; $contents["type"][$i] = $element->structure; $contents["path"][$i] = $element->path;