-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
314 changed files
with
4,188 additions
and
785 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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Phar.io - Phive | ||
|
||
Copyright (c) 2015-2017 Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
Copyright (c) 2015-2020 Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
|
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 |
---|---|---|
@@ -1,6 +1,17 @@ | ||
<?php declare(strict_types = 1); | ||
/* | ||
* This file is part of Phive. | ||
* | ||
* Copyright (c) Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
namespace PharIo\Phive; | ||
|
||
use const PHP_OS; | ||
use function getcwd; | ||
use PharIo\GnuPG\Factory as GnuPGFactory; | ||
use PharIo\Version\VersionConstraintParser; | ||
|
||
|
@@ -50,7 +61,7 @@ public function getHelpCommand(): HelpCommand { | |
|
||
public function getSkelCommand(): SkelCommand { | ||
return new SkelCommand( | ||
new SkelCommandConfig($this->request->parse(new SkelContext()), \getcwd()), | ||
new SkelCommandConfig($this->request->parse(new SkelContext()), getcwd()), | ||
$this->getOutput(), | ||
$this->getPhiveVersion() | ||
); | ||
|
@@ -325,7 +336,7 @@ private function getGit(): Git { | |
|
||
private function getEnvironment(): Environment { | ||
if (null === $this->environment) { | ||
$this->environment = (new EnvironmentLocator())->getEnvironment(\PHP_OS); | ||
$this->environment = (new EnvironmentLocator())->getEnvironment(PHP_OS); | ||
} | ||
|
||
return $this->environment; | ||
|
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 |
---|---|---|
@@ -1,5 +1,16 @@ | ||
<?php declare(strict_types = 1); | ||
/* | ||
* This file is part of Phive. | ||
* | ||
* Copyright (c) Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
namespace PharIo\Phive; | ||
|
||
class GithubAliasResolverException extends \Exception { | ||
use Exception; | ||
|
||
class GithubAliasResolverException extends Exception { | ||
} |
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
<?php declare(strict_types = 1); | ||
/* | ||
* This file is part of Phive. | ||
* | ||
* Copyright (c) Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
namespace PharIo\Phive; | ||
|
||
use PharIo\Phive\Cli\GeneralContext; | ||
|
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 |
---|---|---|
@@ -1,6 +1,17 @@ | ||
<?php declare(strict_types = 1); | ||
/* | ||
* This file is part of Phive. | ||
* | ||
* Copyright (c) Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
namespace PharIo\Phive; | ||
|
||
use function sprintf; | ||
|
||
class CommandLocator implements Cli\CommandLocator { | ||
|
||
/** @var Factory */ | ||
|
@@ -81,7 +92,7 @@ public function getCommand(string $command): Cli\Command { | |
|
||
default: { | ||
throw new Cli\CommandLocatorException( | ||
\sprintf('Command "%s" is not a valid command', $command), | ||
sprintf('Command "%s" is not a valid command', $command), | ||
Cli\CommandLocatorException::UnknownCommand | ||
); | ||
} | ||
|
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 |
---|---|---|
@@ -1,6 +1,17 @@ | ||
<?php declare(strict_types = 1); | ||
/* | ||
* This file is part of Phive. | ||
* | ||
* Copyright (c) Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
namespace PharIo\Phive; | ||
|
||
use function sprintf; | ||
|
||
class ComposerCommand extends InstallCommand { | ||
|
||
/** @var ComposerService */ | ||
|
@@ -26,7 +37,7 @@ public function execute(): void { | |
$targetDirectory = $this->getConfig()->getTargetDirectory(); | ||
|
||
foreach ($this->composerService->findCandidates($this->getConfig()->getComposerFilename()) as $candidate) { | ||
if (!$this->input->confirm(\sprintf('Install %s ?', $candidate->asString()))) { | ||
if (!$this->input->confirm(sprintf('Install %s ?', $candidate->asString()))) { | ||
continue; | ||
} | ||
$this->installRequestedPhar($candidate, $targetDirectory); | ||
|
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
<?php declare(strict_types = 1); | ||
/* | ||
* This file is part of Phive. | ||
* | ||
* Copyright (c) Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
namespace PharIo\Phive; | ||
|
||
use PharIo\FileSystem\Directory; | ||
|
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
<?php declare(strict_types = 1); | ||
/* | ||
* This file is part of Phive. | ||
* | ||
* Copyright (c) Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
namespace PharIo\Phive; | ||
|
||
use PharIo\Phive\Cli\GeneralContext; | ||
|
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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
<?php declare(strict_types = 1); | ||
/* | ||
* This file is part of Phive. | ||
* | ||
* Copyright (c) Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
namespace PharIo\Phive; | ||
|
||
use function sprintf; | ||
use Exception; | ||
use InvalidArgumentException; | ||
use PharIo\FileSystem\Filename; | ||
use PharIo\Version\VersionConstraintParser; | ||
|
||
|
@@ -25,7 +37,7 @@ public function findCandidates(Filename $composerFilename): array { | |
$aliasName = $this->sourcesList->getAliasForComposerAlias(new ComposerAlias($required)); | ||
$versionConstraint = $parser->parse($constraint); | ||
$list[] = new RequestedPhar(new PharAlias($aliasName), $versionConstraint, $versionConstraint); | ||
} catch (\Exception $e) { | ||
} catch (Exception $e) { | ||
continue; | ||
} | ||
} | ||
|
@@ -35,8 +47,8 @@ public function findCandidates(Filename $composerFilename): array { | |
|
||
private function getRequires(Filename $composerFilename): array { | ||
if (!$composerFilename->exists()) { | ||
throw new \InvalidArgumentException( | ||
\sprintf('Specified file %s does not exist', $composerFilename->asString()) | ||
throw new InvalidArgumentException( | ||
sprintf('Specified file %s does not exist', $composerFilename->asString()) | ||
); | ||
} | ||
|
||
|
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
<?php declare(strict_types = 1); | ||
/* | ||
* This file is part of Phive. | ||
* | ||
* Copyright (c) Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
namespace PharIo\Phive; | ||
|
||
class DefaultCommand implements Cli\Command { | ||
|
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
<?php declare(strict_types = 1); | ||
/* | ||
* This file is part of Phive. | ||
* | ||
* Copyright (c) Arne Blankerts <[email protected]>, Sebastian Heuer <[email protected]> and contributors | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
*/ | ||
namespace PharIo\Phive; | ||
|
||
class DefaultCommandConfig { | ||
|
Oops, something went wrong.