-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor for --type support of ee site command #104
Changes from 39 commits
9030635
9dcdd84
ab8c4d0
74dbc3a
106134c
7dbb02f
2535117
a2cbf6a
b947d24
81e5159
1cf1d40
b8ff0f0
2976ebe
a7382df
da2cb12
ebd3eff
0178748
a8af7f1
5df0eaf
000c413
a7f5d88
c9590a5
f5d6cce
eaefba4
828e731
ed5c6e0
eb2e1e4
69b6976
4d9dc92
4f66fc2
75e55f7
6dd18f8
18c462f
077316c
b5c167d
e408a92
72444d8
eb15ce5
a313af6
482b4f8
cd38bc7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Acme PHP project. | ||
* | ||
* (c) Titouan Galopin <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AcmePhp\Cli\Exception; | ||
|
||
/** | ||
* @author Titouan Galopin <[email protected]> | ||
*/ | ||
class AcmeCliActionException extends AcmeCliException | ||
{ | ||
public function __construct($actionName, \Exception $previous = null) | ||
{ | ||
parent::__construct(sprintf('An exception was thrown during action "%s"', $actionName), $previous); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved from EE core to here. |
||
|
||
/* | ||
* This file is part of the Acme PHP project. | ||
* | ||
* (c) Titouan Galopin <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AcmePhp\Cli\Exception; | ||
|
||
/** | ||
* @author Titouan Galopin <[email protected]> | ||
*/ | ||
class AcmeCliException extends \RuntimeException | ||
{ | ||
public function __construct($message, \Exception $previous = null) | ||
{ | ||
parent::__construct($message, 0, $previous); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved from EE core to here. |
||
|
||
/* | ||
* This file is part of the Acme PHP project. | ||
* | ||
* (c) Titouan Galopin <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AcmePhp\Cli\Exception; | ||
|
||
/** | ||
* @author Jérémy Derussé <[email protected]> | ||
*/ | ||
class AcmeDnsResolutionException extends AcmeCliException | ||
{ | ||
public function __construct($message, \Exception $previous = null) | ||
{ | ||
parent::__construct(null === $message ? 'An exception was thrown during resolution of DNS' : $message, $previous); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved from EE core to here. |
||
|
||
/* | ||
* This file is part of the Acme PHP project. | ||
* | ||
* (c) Titouan Galopin <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace AcmePhp\Cli\Exception; | ||
|
||
/** | ||
* @author Jérémy Derussé <[email protected]> | ||
*/ | ||
class CommandFlowException extends AcmeCliException | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $missing; | ||
/** | ||
* @var string | ||
*/ | ||
private $command; | ||
/** | ||
* @var array | ||
*/ | ||
private $arguments; | ||
|
||
/** | ||
* @param string $missing Missing requirement to fix the flow | ||
* @param string $command Name of the command to run in order to fix the flow | ||
* @param array $arguments Optional list of missing arguments | ||
* @param \Exception|null $previous | ||
*/ | ||
public function __construct($missing, $command, array $arguments = [], \Exception $previous = null) | ||
{ | ||
$this->missing = $missing; | ||
$this->command = $command; | ||
$this->arguments = $arguments; | ||
|
||
$message = trim(sprintf( | ||
'You have to %s first. Run the command%sphp %s %s %s', | ||
$missing, | ||
PHP_EOL.PHP_EOL, | ||
$_SERVER['PHP_SELF'], | ||
$command, | ||
implode(' ', $arguments) | ||
)); | ||
|
||
parent::__construct($message, $previous); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved from EE core to here.