Merge branch '1.3'

main
Jordi Boggiano 8 years ago
commit eb5495b8e4

@ -48,6 +48,8 @@ if (function_exists('ini_set')) {
unset($memoryInBytes, $memoryLimit);
}
putenv('COMPOSER_BINARY='.realpath($_SERVER['argv'][0]));
// run the command application
$application = new Application();
$application->run(null, $output);

@ -23,6 +23,7 @@ use Composer\Package\BasePackage;
use Composer\DependencyResolver\Pool;
use Composer\DependencyResolver\Operation\InstallOperation;
use Composer\Package\Version\VersionSelector;
use Composer\Package\AliasPackage;
use Composer\Repository\RepositoryFactory;
use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
@ -330,6 +331,10 @@ EOT
$io->writeError('<info>Plugins have been disabled.</info>');
}
if ($package instanceof AliasPackage) {
$package = $package->getAliasOf();
}
if (0 === strpos($package->getPrettyVersion(), 'dev-') && in_array($package->getSourceType(), array('git', 'hg'))) {
$package->setSourceReference(substr($package->getPrettyVersion(), 4));
}

@ -173,7 +173,7 @@ EOT
}
$io->writeError('Package ' . $packageFilter . ' not found in ' . $options['working-dir'] . '/composer.json');
return;
return 1;
}
} else {
$versions = array($package->getPrettyVersion() => $package->getVersion());

@ -166,7 +166,7 @@ class Application extends BaseApplication
$io->writeError('<warning>Composer only officially supports PHP 5.3.2 and above, you will most likely encounter problems with your PHP '.PHP_VERSION.', upgrading is strongly recommended.</warning>');
}
if (extension_loaded('xdebug') && (!getenv('COMPOSER_DISABLE_XDEBUG_WARN') || getenv('COMPOSER_ALLOW_XDEBUG'))) {
if (extension_loaded('xdebug') && !getenv('COMPOSER_DISABLE_XDEBUG_WARN')) {
$io->writeError('<warning>You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug</warning>');
}

@ -175,12 +175,7 @@ class EventDispatcher
$args = $event->getArguments();
$flags = $event->getFlags();
if (substr($callable, 0, 10) === '@composer ') {
$finder = new PhpExecutableFinder();
$phpPath = $finder->find();
if (!$phpPath) {
throw new \RuntimeException('Failed to locate PHP binary to execute '.$scriptName);
}
$exec = $phpPath . ' ' . realpath($_SERVER['argv'][0]) . substr($callable, 9);
$exec = $this->getPhpExecCommand() . ' ' . ProcessExecutor::escape(getenv('COMPOSER_BINARY')) . substr($callable, 9);
if (0 !== ($exitCode = $this->process->execute($exec))) {
$this->io->writeError(sprintf('<error>Script %s handling the %s event returned with error code '.$exitCode.'</error>', $callable, $event->getName()));
@ -234,12 +229,7 @@ class EventDispatcher
}
if (substr($exec, 0, 5) === '@php ') {
$finder = new PhpExecutableFinder();
$phpPath = $finder->find();
if (!$phpPath) {
throw new \RuntimeException('Failed to locate PHP binary to execute "'.$exec.'"');
}
$exec = $phpPath . ' ' . substr($exec, 5);
$exec = $this->getPhpExecCommand() . ' ' . substr($exec, 5);
}
if (0 !== ($exitCode = $this->process->execute($exec))) {
@ -259,6 +249,19 @@ class EventDispatcher
return $return;
}
protected function getPhpExecCommand()
{
$finder = new PhpExecutableFinder();
$phpPath = $finder->find();
if (!$phpPath) {
throw new \RuntimeException('Failed to locate PHP binary to execute '.$scriptName);
}
$memoryFlag = ' -d memory_limit='.ini_get('memory_limit');
return ProcessExecutor::escape($phpPath) . $memoryFlag;
}
/**
* @param string $className
* @param string $methodName

@ -605,7 +605,7 @@ class Installer
$this->eventDispatcher->dispatchPackageEvent(constant($event), $this->devMode, $policy, $pool, $installedRepo, $request, $operations, $operation);
}
if ($this->executeOperations) {
if ($this->executeOperations || $this->writeLock) {
$localRepo->write();
}
}

Loading…
Cancel
Save