Skip to content

Commit

Permalink
RC5 with added input to override php binary
Browse files Browse the repository at this point in the history
  • Loading branch information
fooman committed Nov 8, 2020
1 parent 003c55b commit 00aa7b9
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ sh -ic "$(curl -sS https://raw.githubusercontent.com/extdn/installer-m2/master/b
```

### Option 2 - Phar
Download and save the [ExtDN_Installer](https://github.com/extdn/installer-m2/raw/v1.0.0-rc4/build/extdn_installer.phar). Ensure it is executable with `chmod +x extdn_installer.phar`.
Download and save the [ExtDN_Installer](https://github.com/extdn/installer-m2/raw/v1.0.0-rc5/build/extdn_installer.phar). Ensure it is executable with `chmod +x extdn_installer.phar`.

#### Phar Installation from packagist or Marketplace
(essentially all previously pre-configured composer repositories)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0-rc4
1.0.0-rc5
2 changes: 1 addition & 1 deletion bin/oneliner.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
curl -sSL https://github.com/extdn/installer-m2/raw/v1.0.0-rc4/build/extdn_installer.phar -o extdn_installer.phar
curl -sSL https://github.com/extdn/installer-m2/raw/v1.0.0-rc5/build/extdn_installer.phar -o extdn_installer.phar
chmod +x extdn_installer.phar
./extdn_installer.phar $@
RET_VALUE=$?
Expand Down
Binary file modified build/extdn_installer.phar
Binary file not shown.
26 changes: 20 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/Command/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public function getOption($key)
*/
public function install(
$package,
$options = ['repo-url' => null, 'template'=>'pre-configured']
$options = ['repo-url' => null, 'template'=>'pre-configured', 'php-bin'=> '/usr/bin/env php']
) {
$this->say($this->getBanner());
$this->options = $options;
$this->options['package'] = $package;

\ExtDN\Task\BaseBinMagento::configure('php-bin', $this->getOption('php-bin'));
$this->stopOnFail(true);

try {
Expand All @@ -51,6 +51,7 @@ public function install(
$this->loadMageEnv();

# TODO check environment? POSIX? ie enough memory?
# TODO compare current php version to what is needed in vendor/magento/magento2-base/composer.json
# TODO check for snowdog frontools?
# TODO checks for broken frontends

Expand Down Expand Up @@ -162,7 +163,7 @@ private function out($msg)

private function getComposerPath()
{
return '/usr/bin/env php -d memory_limit=-1 -f vendor/composer/composer/bin/composer';
return $this->getOption('php-bin') .' -d memory_limit=-1 -f vendor/composer/composer/bin/composer';
}

private function checkMagentoMode()
Expand All @@ -185,7 +186,7 @@ private function checkMagentoMode()
'Install in a development environment and use your standard deployment process.',
'',
'Switch to developer mode manually before re-running the installer.',
'/usr/bin/env php -f bin/magento deploy:mode:set developer',
$this->getOption('php-bin') .' -f bin/magento deploy:mode:set developer',
'',
'Re-run this installer with the above question answered yes.'
]
Expand Down
20 changes: 17 additions & 3 deletions src/Task/BaseBinMagento.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,29 @@
use Robo\Contract\BuilderAwareInterface;
use Robo\Result;

abstract class BaseBinMagento extends \Robo\Task\BaseTask implements BuilderAwareInterface
class BaseBinMagento extends \Robo\Task\BaseTask implements BuilderAwareInterface
{

use \Robo\Common\BuilderAwareTrait;
use \Robo\Common\ConfigAwareTrait;

const CMD_NOTICE = '';
const BIN_COMMAND = '';

protected $silent = false;

protected static function configPrefix()
{
return 'task.ExtDN.BaseBinMagento.';
}

private static function getClassKey($key)
{
$configPrefix = static::configPrefix(); // task.ExtDN.BaseBinMagento.
$configPostFix = static::configPostfix(); // .settings
return sprintf('%s%s.%s', $configPrefix, $configPostFix, $key);
}

/**
* @return \Robo\Result
*/
Expand Down Expand Up @@ -50,7 +63,8 @@ protected function getCommand()

protected function constructBinMagentoCommand($cmd)
{
$this->printTaskDebug('/usr/bin/env php -d memory_limit=-1 -f bin/magento ' . $cmd);
return '/usr/bin/env php -d memory_limit=-1 -f bin/magento ' . $cmd;
$phpBin = $this->getConfigValue('php-bin');
$this->printTaskDebug($phpBin . ' -d memory_limit=-1 -f bin/magento ' . $cmd);
return $phpBin .' -d memory_limit=-1 -f bin/magento ' . $cmd;
}
}

0 comments on commit 00aa7b9

Please sign in to comment.