1
0
Fork 0

Cosmetic fixes

pull/736/head
Jordi Boggiano 2012-05-27 23:21:10 +02:00
parent 76f727b273
commit 8ffe3c2e26
4 changed files with 6 additions and 5 deletions

View File

@ -2,7 +2,7 @@
* Schema: Added references for dev versions, requiring `dev-master#abcdef` for example will force the abcdef commit * Schema: Added references for dev versions, requiring `dev-master#abcdef` for example will force the abcdef commit
* Added `require` command to add a package to your requirements and install it * Added `require` command to add a package to your requirements and install it
* Added a whitelist to `update. Calling `composer update foo/bar foo/baz` allows you to update only those packages * Added a whitelist to `update`. Calling `composer update foo/bar foo/baz` allows you to update only those packages
* Added caching of GitHub metadata (faster startup time with custom GitHub VCS repos) * Added caching of GitHub metadata (faster startup time with custom GitHub VCS repos)
* Added support for file:// URLs to GitDriver * Added support for file:// URLs to GitDriver
* Added --dev flag to `create-project` command * Added --dev flag to `create-project` command

View File

@ -70,7 +70,7 @@ EOT
$requireKey = $input->getOption('dev') ? 'require-dev' : 'require'; $requireKey = $input->getOption('dev') ? 'require-dev' : 'require';
$baseRequirements = array_key_exists($requireKey, $composer) ? $composer[$requireKey] : array(); $baseRequirements = array_key_exists($requireKey, $composer) ? $composer[$requireKey] : array();
$requirements = $this->formatRequirements($requirements); $requirements = $this->formatRequirements($requirements);
if (!$this->updateFileCleanly($json, $baseRequirements, $requirements, $requireKey)) { if (!$this->updateFileCleanly($json, $baseRequirements, $requirements, $requireKey)) {
foreach ($requirements as $package => $version) { foreach ($requirements as $package => $version) {

View File

@ -337,7 +337,7 @@ class Installer
} else { } else {
// force update to latest on update // force update to latest on update
if ($this->update) { if ($this->update) {
// skip package is the whitelist is enabled and it is not in it // skip package if the whitelist is enabled and it is not in it
if ($this->updateWhitelist && !in_array($package->getName(), $this->updateWhitelist)) { if ($this->updateWhitelist && !in_array($package->getName(), $this->updateWhitelist)) {
continue; continue;
} }

View File

@ -23,11 +23,12 @@ class JsonManipulator
public function __construct($contents) public function __construct($contents)
{ {
if (!preg_match('#^\{(.*)\}$#s', trim($contents), $match)) { $contents = trim($contents);
if (!preg_match('#^\{(.*)\}$#s', $contents)) {
throw new \InvalidArgumentException('The json file must be an object ({})'); throw new \InvalidArgumentException('The json file must be an object ({})');
} }
$this->newline = false !== strpos("\r\n", $contents) ? "\r\n": "\n"; $this->newline = false !== strpos("\r\n", $contents) ? "\r\n": "\n";
$this->contents = '{' . $match[1] . '}'; $this->contents = $contents;
$this->detectIndenting(); $this->detectIndenting();
} }