Skip to content

Commit

Permalink
Merge branch 'release/1.97.27'
Browse files Browse the repository at this point in the history
  • Loading branch information
ktomk committed Dec 11, 2016
2 parents bb289e7 + a61e9d3 commit 4630f97
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 31 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
@@ -1,10 +1,16 @@
RECENT CHANGES
==============

1.97.27
-------
* Fix: Sourceforge moved to https (by Tom Klingenberg)
* Fix: Broken sample-data tar.gz file (report by AreDubya, #879)
* Fix: Self-check in fake phar (report by Liviu Panainte, thanks!)

1.97.26
-------
* Upd: bash autocomplete-file
* Imp: Hide password when asked by admin:user:change-password (reported by Faisal Mirza, #873)
* Imp: Hide password when asked by admin:user:change-password (report by Faisal Mirza, #873)

1.97.25
-------
Expand Down
6 changes: 4 additions & 2 deletions build.sh
Expand Up @@ -23,11 +23,13 @@ echo "Building ${phar}..."

remove_assume_unchanged "." "${phar}"

echo "$0 executed in $(pwd -P)"
base_dir="$(pwd -P)"
echo "$0 executed in ${base_dir}"

build_dir="build/output"
finish() {
rm -rf "${build_dir}"
echo "trap exit removing '${build_dir}'.."
rm -rf "${base_dir}/${build_dir}"
}
trap finish EXIT

Expand Down
12 changes: 6 additions & 6 deletions config.yaml
Expand Up @@ -449,35 +449,35 @@ commands:
- name: sample-data-1.9.2.4
version: 1.9.2.4
dist:
url: http://sourceforge.net/projects/mageloads/files/assets/1.9.2.4/magento-sample-data-1.9.2.4.tar.gz
url: https://sourceforge.net/projects/mageloads/files/assets/1.9.2.4/magento-sample-data-1.9.2.4-fix.tar.gz
type: tar
shasum: 5ad29dc3df38d21b2407c49f66d5308b01961d60
shasum: fe5930d0f41c2b5e92b86f7f7fc4247c927efa01

- name: sample-data-1.9.1.0
version: 1.9.1.0
dist:
url: http://sourceforge.net/projects/mageloads/files/assets/1.9.1.0/magento-sample-data-1.9.1.0.tar.gz
url: https://sourceforge.net/projects/mageloads/files/assets/1.9.1.0/magento-sample-data-1.9.1.0.tar.gz
type: tar
shasum: 617e0271900772ac8f11e7bb86e29fca0f640562

- name: sample-data-1.9.0.0
version: 1.9.0.0
dist:
url: http://sourceforge.net/projects/mageloads/files/assets/1.9.0.0/magento-sample-data-1.9.0.0.tar.gz
url: https://sourceforge.net/projects/mageloads/files/assets/1.9.0.0/magento-sample-data-1.9.0.0.tar.gz
type: tar
shasum: b2b535901eb2db92a8602baf8a839ab2120c4c8f

- name: sample-data-1.6.1.0
version: 1.6.1.0
dist:
url: http://sourceforge.net/projects/mageloads/files/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
url: https://sourceforge.net/projects/mageloads/files/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
type: tar
shasum: a9226bc92966855327f6eb62ff8f6c562b2113a2

- name: sample-data-1.1.2
version: 1.1.2
dist:
url: http://sourceforge.net/projects/mageloads/files/assets/1.1.2/magento-sample-data-1.1.2.zip
url: https://sourceforge.net/projects/mageloads/files/assets/1.1.2/magento-sample-data-1.1.2.zip
type: zip
shasum: 6bbb57e387c59da2752fe013aadef6dcd3cd2b29

Expand Down
2 changes: 2 additions & 0 deletions n98-magerun.phar
Expand Up @@ -7,7 +7,9 @@

echo "Info: Magerun has not been downloaded yet, downloading it ...\n";

$url = 'https://files.magerun.net/n98-magerun.phar';
$target = 'n98-magerun.phar';

$old = md5_file($target);
$file = @fopen($url, 'r');
if ($file === false) {
Expand Down
21 changes: 12 additions & 9 deletions src/N98/Magento/Application.php
Expand Up @@ -38,7 +38,7 @@ class Application extends BaseApplication
/**
* @var string
*/
const APP_VERSION = '1.97.26';
const APP_VERSION = '1.97.27';

/**
* @var int
Expand Down Expand Up @@ -297,6 +297,7 @@ protected function hasCustomCommands()
trigger_error(__METHOD__ . ' moved, use config directly instead', E_USER_DEPRECATED);

$config = $this->config->getConfig();

return isset($config['commands']['customCommands']) && is_array($config['commands']['customCommands']);
}

Expand All @@ -319,6 +320,7 @@ protected function isCommandDisabled($class)
trigger_error(__METHOD__ . ' moved, use config directly instead', E_USER_DEPRECATED);

$config = $this->config->getConfig();

return in_array($class, $config['commands']['disabled']);
}

Expand Down Expand Up @@ -632,19 +634,14 @@ public function init(array $initConfig = array(), InputInterface $input = null,
$this->dispatcher = new EventDispatcher();
$this->setDispatcher($this->dispatcher);

if (null === $input) {
$input = new ArgvInput();
}

if (null === $output) {
$output = new ConsoleOutput();
}
$input = $input ?: new ArgvInput();
$output = $output ?: new ConsoleOutput();

if (null !== $this->config) {
throw new UnexpectedValueException(sprintf('Config already initialized'));
}

$loadExternalConfig = !$this->_checkSkipConfigOption($input);
$loadExternalConfig = !$input->hasParameterOption('--skip-config');

$this->config = $config = new Config($initConfig, $this->isPharMode(), $output);
if ($this->configurationLoaderInjected) {
Expand Down Expand Up @@ -697,9 +694,15 @@ protected function registerEventSubscribers()
/**
* @param InputInterface $input
* @return bool
* @deprecated 1.97.27
*/
protected function _checkSkipConfigOption(InputInterface $input)
{
trigger_error(
__METHOD__ . ' removed, use $input->hasParameterOption(\'--skip-config\') instead',
E_USER_DEPRECATED
);

return $input->hasParameterOption('--skip-config');
}

Expand Down
50 changes: 39 additions & 11 deletions src/N98/Magento/Application/Config.php
Expand Up @@ -27,6 +27,11 @@
*/
class Config
{
const PSR_0 = 'PSR-0';
const PSR_4 = 'PSR-4';

const COMMAND_CLASS = 'Symfony\Component\Console\Command\Command';

/**
* @var array config data
*/
Expand Down Expand Up @@ -141,15 +146,28 @@ public function registerCustomCommands(Application $application)
$commandName = key($commandClass);
$commandClass = current($commandClass);
}
$command = $this->newCommand($commandClass, $commandName);
$this->debugWriteln(
sprintf(
'<debug>Add command </debug> <info>%s</info> -> <comment>%s</comment>',
$command->getName(),
get_class($command)
)
);
$application->add($command);
if (null === $command = $this->newCommand($commandClass, $commandName)) {
$this->output->writeln(
sprintf(
'<error>Can not add nonexistent command class "%s" as command to the application</error>',
$commandClass,
$commandName
)
);
$this->debugWriteln(
'Please check the configuration files contain the correct class-name. If the ' .
'class-name is correct, check autoloader configurations.'
);
} else {
$this->debugWriteln(
sprintf(
'<debug>Add command </debug> <info>%s</info> -> <comment>%s</comment>',
$command->getName(),
get_class($command)
)
);
$application->add($command);
}
}
}

Expand All @@ -168,6 +186,16 @@ private function newCommand($className, $commandName)
);
}

if (!class_exists($className)) {
return null;
}

if (false === is_subclass_of($className, self::COMMAND_CLASS, true)) {
throw new InvalidArgumentException(
sprintf('Class "%s" is not a Command (subclass of "%s")', $className, self::COMMAND_CLASS)
);
}

$command = new $className();
if (null !== $commandName) {
$command->setName($commandName);
Expand All @@ -187,14 +215,14 @@ public function registerCustomAutoloaders(ClassLoader $autoloader)

foreach ($this->getArray('autoloaders') as $prefix => $paths) {
$paths = (array) $paths;
$this->debugWriteln(sprintf($mask, self::PSR_0, OutputFormatter::escape($prefix), implode(",", $paths)));
$autoloader->add($prefix, $paths);
$this->debugWriteln(sprintf($mask, 'PSR-2', $prefix, implode(",", $paths)));
}

foreach ($this->getArray('autoloaders_psr4') as $prefix => $paths) {
$paths = (array) $paths;
$this->debugWriteln(sprintf($mask, self::PSR_4, OutputFormatter::escape($prefix), implode(",", $paths)));
$autoloader->addPsr4($prefix, $paths);
$this->debugWriteln(sprintf($mask, 'PSR-4', OutputFormatter::escape($prefix), implode(",", $paths)));
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/N98/Magento/Application/ConfigurationLoader.php
Expand Up @@ -159,9 +159,11 @@ protected function loadDistConfig(array $initConfig)
{
if ($this->_distConfig == null) {
$distConfigFilePath = __DIR__ . '/../../../../config.yaml';
$this->logDebug('Load dist config <comment>' . $distConfigFilePath . '</comment>');
$this->_distConfig = ConfigFile::createFromFile($distConfigFilePath)->toArray();
} else {
$this->logDebug('Load dist config <comment>cached</comment>');
}
$this->logDebug('Load dist config');

$config = ArrayFunctions::mergeArrays($this->_distConfig, $initConfig);

Expand Down
2 changes: 1 addition & 1 deletion version.txt
@@ -1 +1 @@
1.97.26
1.97.27

0 comments on commit 4630f97

Please sign in to comment.