-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TASK: Add packagist.org repository by default
- Loading branch information
1 parent
d42b68c
commit a065b61
Showing
1 changed file
with
12 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,7 +178,7 @@ class ComposerJson extends AbstractClass | |
* @var array | ||
*/ | ||
protected $nonFeatureBranches; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
|
@@ -194,7 +194,7 @@ class ComposerJson extends AbstractClass | |
public function __construct(array $data = []) | ||
{ | ||
$this->_data = $data; | ||
|
||
// String data | ||
$this->name = (array_key_exists('name', $data) ? $data['name'] : ''); | ||
$this->description = (array_key_exists('description', $data) ? $data['description'] : ''); | ||
|
@@ -241,7 +241,7 @@ public function __construct(array $data = []) | |
if (is_string($license)) { | ||
$license = [$license]; | ||
} | ||
|
||
$this->license = $license; | ||
} | ||
|
||
|
@@ -258,6 +258,14 @@ public function __construct(array $data = []) | |
$this->repositories[] = new Repository($repository); | ||
} | ||
} | ||
|
||
if (!array_key_exists('repositories', $data) || (array_key_exists('packagist.org', $data['repositories']) && $data['repositories']['packagist.org'] !== false)) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
MCStreetguy
Author
Owner
|
||
$this->repositories['packagist.org'] = new Repository([ | ||
'type' => 'composer', | ||
'url' => 'https?://repo.packagist.org', | ||
'allow_ssl_downgrade' => true, | ||
]); | ||
} | ||
} | ||
|
||
/** | ||
|
@@ -569,7 +577,7 @@ public function getNonFeatureBranches() | |
{ | ||
return $this->nonFeatureBranches; | ||
} | ||
|
||
/** | ||
* Get the whole manifest file as array. | ||
* | ||
|
Is it right way to check for
{"packagist.org": false}
repository object?It looks like
$data['repositories']['packagist.org'] !== false
will check for:And we need to check it for: