Skip to content

Commit

Permalink
Merge pull request #50 from rollun-com/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
victorynox authored Dec 16, 2017
2 parents 2da7bde + 710c4c3 commit 9533d3c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
10 changes: 6 additions & 4 deletions src/Installer/src/InstallerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function __construct()
"-l",
InputOption::VALUE_OPTIONAL,
"Output language.",
null
"en"
);

//TODO: remove this. see isDebug (OutputInterface or --verbose options)
Expand All @@ -66,10 +66,12 @@ public function __construct()
protected function execute(InputInterface $input, OutputInterface $output)
{
try {
$rootInstaller = new RootInstaller($this->getComposer(), $this->getIO());
$isDebug =(bool)($input->getOption("debug") || $input->getOption("verbose"));
define("isDebug", $isDebug);

$rootInstaller = new RootInstaller($this->getComposer(), $this->getIO());

$lang = $input->getOption("lang");
$isDebug =(bool)($input->getOption("debug") || $input->getOption("verbose"));
define("isDebug", $isDebug);
switch ($input->getArgument("type"))
{
case self::CMD_ARG_INSTALL:
Expand Down
25 changes: 15 additions & 10 deletions src/Installer/src/InstallerCommandProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
use Composer\Plugin\Capable;
use Composer\Plugin\PluginInterface;

/**
* @deprecated
*/
if(file_exists('vendor/webimpress/http-middleware-compatibility/autoload/http-middleware.php')) {
require_once 'vendor/webimpress/http-middleware-compatibility/autoload/http-middleware.php';
}
if(file_exists('config/env_configurator.php')) {
require_once 'config/env_configurator.php';
}

class InstallerCommandProvider implements CommandProvider, PluginInterface, Capable
{
Expand All @@ -48,7 +39,21 @@ public function activate(Composer $composer, IOInterface $io)
$this->composer = $composer;
$this->io = $io;

//TODO: remove this gilt. Need for support back compatibility.
if(file_exists('config/env_configurator.php')) {
require_once 'config/env_configurator.php';
trigger_error("This functional is deprecated. You may use config for this. For more info read https://github.com/rollun-com/all-standards", E_USER_DEPRECATED);
}

//generate autoloader. load all class.
$localRepository = $composer->getRepositoryManager()->getLocalRepository();
$packageMap = $composer->getAutoloadGenerator()->buildPackageMap(
$composer->getInstallationManager(),
$composer->getPackage(),
$localRepository->getPackages()
);
$autoload = $composer->getAutoloadGenerator()->parseAutoloads($packageMap, $composer->getPackage());
$loader = $composer->getAutoloadGenerator()->createLoader($autoload);
spl_autoload_register([$loader, "loadClass"]);
}

/**
Expand Down
8 changes: 5 additions & 3 deletions src/Installer/src/RootInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ private function reloadContainer()

//define new env constant.
$config = $this->container->get("config");
foreach ($config['env_config'] as $envName => $envValue) {
if(!defined($envName)) {
define($envName, $envValue);
if(isset($config['env_config'])) {
foreach ($config['env_config'] as $envName => $envValue) {
if(!defined($envName)) {
define($envName, $envValue);
}
}
}
}
Expand Down

0 comments on commit 9533d3c

Please sign in to comment.