Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/updater.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/bamarni/composer-bin-plugin/src/Config.php')
-rw-r--r--vendor/bamarni/composer-bin-plugin/src/Config.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/bamarni/composer-bin-plugin/src/Config.php b/vendor/bamarni/composer-bin-plugin/src/Config.php
new file mode 100644
index 0000000..4e98a65
--- /dev/null
+++ b/vendor/bamarni/composer-bin-plugin/src/Config.php
@@ -0,0 +1,47 @@
+<?php
+
+namespace Bamarni\Composer\Bin;
+
+use Composer\Composer;
+
+final class Config
+{
+ private $config;
+
+ public function __construct(Composer $composer)
+ {
+ $extra = $composer->getPackage()->getExtra();
+ $this->config = array_merge(
+ [
+ 'bin-links' => true,
+ 'target-directory' => 'vendor-bin',
+ 'forward-command' => false,
+ ],
+ isset($extra['bamarni-bin']) ? $extra['bamarni-bin'] : []
+ );
+ }
+
+ /**
+ * @return bool
+ */
+ public function binLinksAreEnabled()
+ {
+ return true === $this->config['bin-links'];
+ }
+
+ /**
+ * @return string
+ */
+ public function getTargetDirectory()
+ {
+ return $this->config['target-directory'];
+ }
+
+ /**
+ * @return bool
+ */
+ public function isCommandForwarded()
+ {
+ return $this->config['forward-command'];
+ }
+}