@@ -15,45 +15,45 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class SkipPatchCommand extends Command |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * @var PatchService |
|
| 20 | - */ |
|
| 21 | - private $patchService; |
|
| 18 | + /** |
|
| 19 | + * @var PatchService |
|
| 20 | + */ |
|
| 21 | + private $patchService; |
|
| 22 | 22 | |
| 23 | - public function __construct(PatchService $patchService) |
|
| 24 | - { |
|
| 25 | - parent::__construct(); |
|
| 26 | - $this->patchService = $patchService; |
|
| 27 | - } |
|
| 23 | + public function __construct(PatchService $patchService) |
|
| 24 | + { |
|
| 25 | + parent::__construct(); |
|
| 26 | + $this->patchService = $patchService; |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * {@inheritdoc} |
|
| 32 | - */ |
|
| 33 | - protected function configure() |
|
| 34 | - { |
|
| 35 | - $this |
|
| 36 | - ->setName('patches:skip') |
|
| 37 | - ->setDescription('Skip a patch.') |
|
| 38 | - ->addArgument( |
|
| 39 | - 'name', |
|
| 40 | - InputArgument::REQUIRED, |
|
| 41 | - 'The name of the patch instance to be skipped' |
|
| 42 | - ) |
|
| 43 | - ->setHelp(<<<EOT |
|
| 30 | + /** |
|
| 31 | + * {@inheritdoc} |
|
| 32 | + */ |
|
| 33 | + protected function configure() |
|
| 34 | + { |
|
| 35 | + $this |
|
| 36 | + ->setName('patches:skip') |
|
| 37 | + ->setDescription('Skip a patch.') |
|
| 38 | + ->addArgument( |
|
| 39 | + 'name', |
|
| 40 | + InputArgument::REQUIRED, |
|
| 41 | + 'The name of the patch instance to be skipped' |
|
| 42 | + ) |
|
| 43 | + ->setHelp(<<<EOT |
|
| 44 | 44 | Skips a patch. You must pass in parameter the name of the patch. |
| 45 | 45 | EOT |
| 46 | - ); |
|
| 47 | - } |
|
| 46 | + ); |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * {@inheritdoc} |
|
| 51 | - */ |
|
| 52 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 53 | - { |
|
| 54 | - $patchName = $input->getArgument('name'); |
|
| 55 | - $this->patchService->skip($patchName); |
|
| 49 | + /** |
|
| 50 | + * {@inheritdoc} |
|
| 51 | + */ |
|
| 52 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 53 | + { |
|
| 54 | + $patchName = $input->getArgument('name'); |
|
| 55 | + $this->patchService->skip($patchName); |
|
| 56 | 56 | |
| 57 | - $output->writeln('Patch marked as skipped'); |
|
| 58 | - } |
|
| 57 | + $output->writeln('Patch marked as skipped'); |
|
| 58 | + } |
|
| 59 | 59 | } |
@@ -15,47 +15,47 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class ApplyPatchCommand extends Command |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * @var PatchService |
|
| 20 | - */ |
|
| 21 | - private $patchService; |
|
| 22 | - |
|
| 23 | - public function __construct(PatchService $patchService) |
|
| 24 | - { |
|
| 25 | - parent::__construct(); |
|
| 26 | - $this->patchService = $patchService; |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - |
|
| 30 | - /** |
|
| 31 | - * {@inheritdoc} |
|
| 32 | - */ |
|
| 33 | - protected function configure() |
|
| 34 | - { |
|
| 35 | - $this |
|
| 36 | - ->setName('patches:apply') |
|
| 37 | - ->setDescription('Apply a patch.') |
|
| 38 | - ->addArgument( |
|
| 39 | - 'name', |
|
| 40 | - InputArgument::REQUIRED, |
|
| 41 | - 'The name of the patch instance to be applied' |
|
| 42 | - ) |
|
| 43 | - ->setHelp(<<<EOT |
|
| 18 | + /** |
|
| 19 | + * @var PatchService |
|
| 20 | + */ |
|
| 21 | + private $patchService; |
|
| 22 | + |
|
| 23 | + public function __construct(PatchService $patchService) |
|
| 24 | + { |
|
| 25 | + parent::__construct(); |
|
| 26 | + $this->patchService = $patchService; |
|
| 27 | + } |
|
| 28 | + |
|
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * {@inheritdoc} |
|
| 32 | + */ |
|
| 33 | + protected function configure() |
|
| 34 | + { |
|
| 35 | + $this |
|
| 36 | + ->setName('patches:apply') |
|
| 37 | + ->setDescription('Apply a patch.') |
|
| 38 | + ->addArgument( |
|
| 39 | + 'name', |
|
| 40 | + InputArgument::REQUIRED, |
|
| 41 | + 'The name of the patch instance to be applied' |
|
| 42 | + ) |
|
| 43 | + ->setHelp(<<<EOT |
|
| 44 | 44 | Apply a patch. You must pass in parameter the name of the patch. |
| 45 | 45 | |
| 46 | 46 | Use patches:apply-all to apply all pending patches. |
| 47 | 47 | EOT |
| 48 | - ); |
|
| 49 | - } |
|
| 50 | - |
|
| 51 | - /** |
|
| 52 | - * {@inheritdoc} |
|
| 53 | - */ |
|
| 54 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 55 | - { |
|
| 56 | - $patchName = $input->getArgument('name'); |
|
| 57 | - $this->patchService->apply($patchName); |
|
| 58 | - |
|
| 59 | - $output->writeln('Patch successfully applied'); |
|
| 60 | - } |
|
| 48 | + ); |
|
| 49 | + } |
|
| 50 | + |
|
| 51 | + /** |
|
| 52 | + * {@inheritdoc} |
|
| 53 | + */ |
|
| 54 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 55 | + { |
|
| 56 | + $patchName = $input->getArgument('name'); |
|
| 57 | + $this->patchService->apply($patchName); |
|
| 58 | + |
|
| 59 | + $output->writeln('Patch successfully applied'); |
|
| 60 | + } |
|
| 61 | 61 | } |
@@ -15,45 +15,45 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class RevertPatchCommand extends Command |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * @var PatchService |
|
| 20 | - */ |
|
| 21 | - private $patchService; |
|
| 18 | + /** |
|
| 19 | + * @var PatchService |
|
| 20 | + */ |
|
| 21 | + private $patchService; |
|
| 22 | 22 | |
| 23 | - public function __construct(PatchService $patchService) |
|
| 24 | - { |
|
| 25 | - parent::__construct(); |
|
| 26 | - $this->patchService = $patchService; |
|
| 27 | - } |
|
| 23 | + public function __construct(PatchService $patchService) |
|
| 24 | + { |
|
| 25 | + parent::__construct(); |
|
| 26 | + $this->patchService = $patchService; |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * {@inheritdoc} |
|
| 32 | - */ |
|
| 33 | - protected function configure() |
|
| 34 | - { |
|
| 35 | - $this |
|
| 36 | - ->setName('patches:revert') |
|
| 37 | - ->setDescription('Revert a patch.') |
|
| 38 | - ->addArgument( |
|
| 39 | - 'name', |
|
| 40 | - InputArgument::REQUIRED, |
|
| 41 | - 'The name of the patch instance to be reverted' |
|
| 42 | - ) |
|
| 43 | - ->setHelp(<<<EOT |
|
| 30 | + /** |
|
| 31 | + * {@inheritdoc} |
|
| 32 | + */ |
|
| 33 | + protected function configure() |
|
| 34 | + { |
|
| 35 | + $this |
|
| 36 | + ->setName('patches:revert') |
|
| 37 | + ->setDescription('Revert a patch.') |
|
| 38 | + ->addArgument( |
|
| 39 | + 'name', |
|
| 40 | + InputArgument::REQUIRED, |
|
| 41 | + 'The name of the patch instance to be reverted' |
|
| 42 | + ) |
|
| 43 | + ->setHelp(<<<EOT |
|
| 44 | 44 | Reverts a patch. You must pass in parameter the name of the patch. |
| 45 | 45 | EOT |
| 46 | - ); |
|
| 47 | - } |
|
| 46 | + ); |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * {@inheritdoc} |
|
| 51 | - */ |
|
| 52 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 53 | - { |
|
| 54 | - $patchName = $input->getArgument('name'); |
|
| 55 | - $this->patchService->revert($patchName); |
|
| 49 | + /** |
|
| 50 | + * {@inheritdoc} |
|
| 51 | + */ |
|
| 52 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 53 | + { |
|
| 54 | + $patchName = $input->getArgument('name'); |
|
| 55 | + $this->patchService->revert($patchName); |
|
| 56 | 56 | |
| 57 | - $output->writeln('Patch successfully reverted'); |
|
| 58 | - } |
|
| 57 | + $output->writeln('Patch successfully reverted'); |
|
| 58 | + } |
|
| 59 | 59 | } |
@@ -30,33 +30,33 @@ discard block |
||
| 30 | 30 | * @ExtendedAction {"name":"View patches list", "url":"patcher/", "default":false} |
| 31 | 31 | */ |
| 32 | 32 | class PatchService implements MoufValidatorInterface { |
| 33 | - const IFEXISTS_EXCEPTION = "exception"; |
|
| 34 | - const IFEXISTS_IGNORE = "ignore"; |
|
| 33 | + const IFEXISTS_EXCEPTION = "exception"; |
|
| 34 | + const IFEXISTS_IGNORE = "ignore"; |
|
| 35 | 35 | |
| 36 | 36 | |
| 37 | - /** |
|
| 37 | + /** |
|
| 38 | 38 | * The list of patches declared for this application. |
| 39 | 39 | * |
| 40 | 40 | * @var PatchInterface[] |
| 41 | 41 | */ |
| 42 | 42 | private $patchs = []; |
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * The list of exiting patch types for this application. |
|
| 46 | - * |
|
| 47 | - * @var PatchType[] |
|
| 48 | - */ |
|
| 44 | + /** |
|
| 45 | + * The list of exiting patch types for this application. |
|
| 46 | + * |
|
| 47 | + * @var PatchType[] |
|
| 48 | + */ |
|
| 49 | 49 | private $types = []; |
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * @param PatchType[] $types |
|
| 53 | - */ |
|
| 54 | - public function __construct(array $types) |
|
| 55 | - { |
|
| 56 | - $this->types = $types; |
|
| 57 | - } |
|
| 51 | + /** |
|
| 52 | + * @param PatchType[] $types |
|
| 53 | + */ |
|
| 54 | + public function __construct(array $types) |
|
| 55 | + { |
|
| 56 | + $this->types = $types; |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - /** |
|
| 59 | + /** |
|
| 60 | 60 | * The list of patches declared for this application. |
| 61 | 61 | * @param PatchInterface[] $patchs |
| 62 | 62 | * @return PatchService |
@@ -66,26 +66,26 @@ discard block |
||
| 66 | 66 | return $this; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * The list of exiting patch types for this application. |
|
| 71 | - * |
|
| 72 | - * @return PatchType[] |
|
| 73 | - */ |
|
| 74 | - public function getTypes(): array |
|
| 75 | - { |
|
| 76 | - return $this->types; |
|
| 77 | - } |
|
| 69 | + /** |
|
| 70 | + * The list of exiting patch types for this application. |
|
| 71 | + * |
|
| 72 | + * @return PatchType[] |
|
| 73 | + */ |
|
| 74 | + public function getTypes(): array |
|
| 75 | + { |
|
| 76 | + return $this->types; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - /** |
|
| 80 | - * @internal Returns a serialized list of types for the patch UI. |
|
| 81 | - * @return array |
|
| 82 | - */ |
|
| 83 | - public function _getSerializedTypes(): array |
|
| 84 | - { |
|
| 85 | - return array_map(function(PatchType $type) { |
|
| 86 | - return $type->jsonSerialize(); |
|
| 87 | - }, $this->types); |
|
| 88 | - } |
|
| 79 | + /** |
|
| 80 | + * @internal Returns a serialized list of types for the patch UI. |
|
| 81 | + * @return array |
|
| 82 | + */ |
|
| 83 | + public function _getSerializedTypes(): array |
|
| 84 | + { |
|
| 85 | + return array_map(function(PatchType $type) { |
|
| 86 | + return $type->jsonSerialize(); |
|
| 87 | + }, $this->types); |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * Adds this patch to the list of existing patches. |
@@ -214,8 +214,8 @@ discard block |
||
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | 216 | * Returns a PHP array representing the patchs. |
| 217 | - * |
|
| 218 | - * @internal |
|
| 217 | + * |
|
| 218 | + * @internal |
|
| 219 | 219 | */ |
| 220 | 220 | public function getView(): array { |
| 221 | 221 | $view = array(); |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | "description"=>$description, |
| 250 | 250 | "error_message"=>$error_message, |
| 251 | 251 | "edit_url"=>$editUrl, |
| 252 | - "patch_type"=>$patchType |
|
| 252 | + "patch_type"=>$patchType |
|
| 253 | 253 | ); |
| 254 | 254 | $view[] = $patchView; |
| 255 | 255 | } |
@@ -8,64 +8,64 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PatchType implements \JsonSerializable |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * @var string |
|
| 13 | - */ |
|
| 14 | - private $name; |
|
| 15 | - /** |
|
| 16 | - * @var string |
|
| 17 | - */ |
|
| 18 | - private $description; |
|
| 11 | + /** |
|
| 12 | + * @var string |
|
| 13 | + */ |
|
| 14 | + private $name; |
|
| 15 | + /** |
|
| 16 | + * @var string |
|
| 17 | + */ |
|
| 18 | + private $description; |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * @Important |
|
| 22 | - * @param string $name The name of the patch type. Should not contain special characters or spaces. Note: the default type is an empty string. |
|
| 23 | - * @param string $description The description of the patch type |
|
| 24 | - * @throws PatchException |
|
| 25 | - */ |
|
| 26 | - public function __construct(string $name, string $description) |
|
| 27 | - { |
|
| 28 | - if (!preg_match('/^[a-z_\-0-9]*$/i', $name)) { |
|
| 29 | - throw new PatchException('A patch name can only contain alphanumeric characters and underscore. Name passed: "'.$name.'"'); |
|
| 30 | - } |
|
| 20 | + /** |
|
| 21 | + * @Important |
|
| 22 | + * @param string $name The name of the patch type. Should not contain special characters or spaces. Note: the default type is an empty string. |
|
| 23 | + * @param string $description The description of the patch type |
|
| 24 | + * @throws PatchException |
|
| 25 | + */ |
|
| 26 | + public function __construct(string $name, string $description) |
|
| 27 | + { |
|
| 28 | + if (!preg_match('/^[a-z_\-0-9]*$/i', $name)) { |
|
| 29 | + throw new PatchException('A patch name can only contain alphanumeric characters and underscore. Name passed: "'.$name.'"'); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - $this->name = $name; |
|
| 33 | - $this->description = $description; |
|
| 34 | - } |
|
| 32 | + $this->name = $name; |
|
| 33 | + $this->description = $description; |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | - /** |
|
| 37 | - * The name of the patch type. Should not contain special characters or spaces. |
|
| 38 | - * |
|
| 39 | - * @return string |
|
| 40 | - */ |
|
| 41 | - public function getName(): string |
|
| 42 | - { |
|
| 43 | - return $this->name; |
|
| 44 | - } |
|
| 36 | + /** |
|
| 37 | + * The name of the patch type. Should not contain special characters or spaces. |
|
| 38 | + * |
|
| 39 | + * @return string |
|
| 40 | + */ |
|
| 41 | + public function getName(): string |
|
| 42 | + { |
|
| 43 | + return $this->name; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * The description of the patch type. |
|
| 48 | - * |
|
| 49 | - * @return string |
|
| 50 | - */ |
|
| 51 | - public function getDescription(): string |
|
| 52 | - { |
|
| 53 | - return $this->description; |
|
| 54 | - } |
|
| 46 | + /** |
|
| 47 | + * The description of the patch type. |
|
| 48 | + * |
|
| 49 | + * @return string |
|
| 50 | + */ |
|
| 51 | + public function getDescription(): string |
|
| 52 | + { |
|
| 53 | + return $this->description; |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * Specify data which should be serialized to JSON |
|
| 58 | - * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
|
| 59 | - * @return mixed data which can be serialized by <b>json_encode</b>, |
|
| 60 | - * which is a value of any type other than a resource. |
|
| 61 | - * @since 5.4.0 |
|
| 62 | - */ |
|
| 63 | - public function jsonSerialize() |
|
| 64 | - { |
|
| 65 | - return [ |
|
| 66 | - 'name' => $this->name, |
|
| 67 | - 'description' => $this->description, |
|
| 68 | - 'instanceName' => MoufManager::getMoufManager()->findInstanceName($this) |
|
| 69 | - ]; |
|
| 70 | - } |
|
| 56 | + /** |
|
| 57 | + * Specify data which should be serialized to JSON |
|
| 58 | + * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
|
| 59 | + * @return mixed data which can be serialized by <b>json_encode</b>, |
|
| 60 | + * which is a value of any type other than a resource. |
|
| 61 | + * @since 5.4.0 |
|
| 62 | + */ |
|
| 63 | + public function jsonSerialize() |
|
| 64 | + { |
|
| 65 | + return [ |
|
| 66 | + 'name' => $this->name, |
|
| 67 | + 'description' => $this->description, |
|
| 68 | + 'instanceName' => MoufManager::getMoufManager()->findInstanceName($this) |
|
| 69 | + ]; |
|
| 70 | + } |
|
| 71 | 71 | } |
@@ -15,66 +15,66 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class ListPatchesCommand extends Command |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * @var PatchService |
|
| 20 | - */ |
|
| 21 | - private $patchService; |
|
| 18 | + /** |
|
| 19 | + * @var PatchService |
|
| 20 | + */ |
|
| 21 | + private $patchService; |
|
| 22 | 22 | |
| 23 | - public function __construct(PatchService $patchService) |
|
| 24 | - { |
|
| 25 | - parent::__construct(); |
|
| 26 | - $this->patchService = $patchService; |
|
| 27 | - } |
|
| 23 | + public function __construct(PatchService $patchService) |
|
| 24 | + { |
|
| 25 | + parent::__construct(); |
|
| 26 | + $this->patchService = $patchService; |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * {@inheritdoc} |
|
| 32 | - */ |
|
| 33 | - protected function configure() |
|
| 34 | - { |
|
| 35 | - $this |
|
| 36 | - ->setName('patches:list') |
|
| 37 | - ->setDescription('List all the patches.') |
|
| 38 | - ->setDefinition(array( |
|
| 30 | + /** |
|
| 31 | + * {@inheritdoc} |
|
| 32 | + */ |
|
| 33 | + protected function configure() |
|
| 34 | + { |
|
| 35 | + $this |
|
| 36 | + ->setName('patches:list') |
|
| 37 | + ->setDescription('List all the patches.') |
|
| 38 | + ->setDefinition(array( |
|
| 39 | 39 | |
| 40 | - )) |
|
| 41 | - ->setHelp(<<<EOT |
|
| 40 | + )) |
|
| 41 | + ->setHelp(<<<EOT |
|
| 42 | 42 | List all patches declared in Mouf patch service. |
| 43 | 43 | |
| 44 | 44 | The command will display the status of each patch, i.e. whether it has been applied or skipped or is waiting to be applied. |
| 45 | 45 | EOT |
| 46 | - ); |
|
| 47 | - } |
|
| 46 | + ); |
|
| 47 | + } |
|
| 48 | 48 | |
| 49 | - /** |
|
| 50 | - * {@inheritdoc} |
|
| 51 | - */ |
|
| 52 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 53 | - { |
|
| 54 | - $patches = $this->patchService->getView(); |
|
| 49 | + /** |
|
| 50 | + * {@inheritdoc} |
|
| 51 | + */ |
|
| 52 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 53 | + { |
|
| 54 | + $patches = $this->patchService->getView(); |
|
| 55 | 55 | |
| 56 | - $rows = array_map(function($row) { |
|
| 57 | - return [ $row['uniqueName'], $this->renderStatus($row['status']), $row['patch_type'] ?: '(default)' ]; |
|
| 58 | - }, $patches); |
|
| 56 | + $rows = array_map(function($row) { |
|
| 57 | + return [ $row['uniqueName'], $this->renderStatus($row['status']), $row['patch_type'] ?: '(default)' ]; |
|
| 58 | + }, $patches); |
|
| 59 | 59 | |
| 60 | - $table = new Table($output); |
|
| 61 | - $table |
|
| 62 | - ->setHeaders(array('Patch', 'Status', 'Type')) |
|
| 63 | - ->setRows($rows) |
|
| 64 | - ; |
|
| 65 | - $table->render(); |
|
| 66 | - } |
|
| 60 | + $table = new Table($output); |
|
| 61 | + $table |
|
| 62 | + ->setHeaders(array('Patch', 'Status', 'Type')) |
|
| 63 | + ->setRows($rows) |
|
| 64 | + ; |
|
| 65 | + $table->render(); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - private function renderStatus($status) { |
|
| 69 | - $map = [ |
|
| 70 | - PatchInterface::STATUS_APPLIED => "<info>Applied</info>", |
|
| 71 | - PatchInterface::STATUS_SKIPPED => "<comment>Skipped</comment>", |
|
| 72 | - PatchInterface::STATUS_AWAITING => "Awaiting", |
|
| 73 | - PatchInterface::STATUS_ERROR => "<error>Skipped</error>", |
|
| 74 | - ]; |
|
| 75 | - if (!isset($map[$status])) { |
|
| 76 | - throw new \Exception('Unexpected status "'.$map[$status].'"'); |
|
| 77 | - } |
|
| 78 | - return $map[$status]; |
|
| 79 | - } |
|
| 68 | + private function renderStatus($status) { |
|
| 69 | + $map = [ |
|
| 70 | + PatchInterface::STATUS_APPLIED => "<info>Applied</info>", |
|
| 71 | + PatchInterface::STATUS_SKIPPED => "<comment>Skipped</comment>", |
|
| 72 | + PatchInterface::STATUS_AWAITING => "Awaiting", |
|
| 73 | + PatchInterface::STATUS_ERROR => "<error>Skipped</error>", |
|
| 74 | + ]; |
|
| 75 | + if (!isset($map[$status])) { |
|
| 76 | + throw new \Exception('Unexpected status "'.$map[$status].'"'); |
|
| 77 | + } |
|
| 78 | + return $map[$status]; |
|
| 79 | + } |
|
| 80 | 80 | } |
@@ -15,71 +15,71 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class ApplyAllPatchesCommand extends Command |
| 17 | 17 | { |
| 18 | - /** |
|
| 19 | - * @var PatchService |
|
| 20 | - */ |
|
| 21 | - private $patchService; |
|
| 18 | + /** |
|
| 19 | + * @var PatchService |
|
| 20 | + */ |
|
| 21 | + private $patchService; |
|
| 22 | 22 | |
| 23 | - public function __construct(PatchService $patchService) |
|
| 24 | - { |
|
| 25 | - $this->patchService = $patchService; |
|
| 26 | - parent::__construct(); |
|
| 27 | - } |
|
| 23 | + public function __construct(PatchService $patchService) |
|
| 24 | + { |
|
| 25 | + $this->patchService = $patchService; |
|
| 26 | + parent::__construct(); |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * {@inheritdoc} |
|
| 32 | - */ |
|
| 33 | - protected function configure() |
|
| 34 | - { |
|
| 35 | - $this |
|
| 36 | - ->setName('patches:apply-all') |
|
| 37 | - ->setDescription('Apply pending patches.') |
|
| 38 | - ->setDefinition(array( |
|
| 30 | + /** |
|
| 31 | + * {@inheritdoc} |
|
| 32 | + */ |
|
| 33 | + protected function configure() |
|
| 34 | + { |
|
| 35 | + $this |
|
| 36 | + ->setName('patches:apply-all') |
|
| 37 | + ->setDescription('Apply pending patches.') |
|
| 38 | + ->setDefinition(array( |
|
| 39 | 39 | |
| 40 | - )) |
|
| 41 | - ->setHelp(<<<EOT |
|
| 40 | + )) |
|
| 41 | + ->setHelp(<<<EOT |
|
| 42 | 42 | Apply pending patches. You can select the type of patches to be applied using the options. Default patches are always applied. |
| 43 | 43 | |
| 44 | 44 | Use patches:apply if you want to cherry-pick a particular patch. |
| 45 | 45 | EOT |
| 46 | - ); |
|
| 46 | + ); |
|
| 47 | 47 | |
| 48 | - foreach ($this->patchService->getTypes() as $type) { |
|
| 49 | - if ($type->getName() !== '') { |
|
| 50 | - $this->addOption($type->getName(), null, InputOption::VALUE_NONE, 'Applies patches of type "'.$type->getName().'". '.$type->getDescription()); |
|
| 51 | - } |
|
| 52 | - } |
|
| 53 | - } |
|
| 48 | + foreach ($this->patchService->getTypes() as $type) { |
|
| 49 | + if ($type->getName() !== '') { |
|
| 50 | + $this->addOption($type->getName(), null, InputOption::VALUE_NONE, 'Applies patches of type "'.$type->getName().'". '.$type->getDescription()); |
|
| 51 | + } |
|
| 52 | + } |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * {@inheritdoc} |
|
| 57 | - */ |
|
| 58 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 59 | - { |
|
| 60 | - $patchesArray = $this->patchService->getView(); |
|
| 55 | + /** |
|
| 56 | + * {@inheritdoc} |
|
| 57 | + */ |
|
| 58 | + protected function execute(InputInterface $input, OutputInterface $output) |
|
| 59 | + { |
|
| 60 | + $patchesArray = $this->patchService->getView(); |
|
| 61 | 61 | |
| 62 | - $count = 0; |
|
| 63 | - try { |
|
| 64 | - foreach ($patchesArray as $patch) { |
|
| 65 | - if ($patch['status'] == PatchInterface::STATUS_AWAITING || $patch['status'] == PatchInterface::STATUS_ERROR) { |
|
| 66 | - $this->patchService->apply($patch['uniqueName']); |
|
| 67 | - $count++; |
|
| 68 | - } |
|
| 69 | - } |
|
| 70 | - } catch (\Exception $e) { |
|
| 71 | - $output->writeln(sprintf( |
|
| 72 | - 'An error occured while applying patch <info>%s</info>: <error>%s</error>', $patch['uniqueName'], $e->getMessage() |
|
| 73 | - )); |
|
| 74 | - throw $e; |
|
| 75 | - } |
|
| 62 | + $count = 0; |
|
| 63 | + try { |
|
| 64 | + foreach ($patchesArray as $patch) { |
|
| 65 | + if ($patch['status'] == PatchInterface::STATUS_AWAITING || $patch['status'] == PatchInterface::STATUS_ERROR) { |
|
| 66 | + $this->patchService->apply($patch['uniqueName']); |
|
| 67 | + $count++; |
|
| 68 | + } |
|
| 69 | + } |
|
| 70 | + } catch (\Exception $e) { |
|
| 71 | + $output->writeln(sprintf( |
|
| 72 | + 'An error occured while applying patch <info>%s</info>: <error>%s</error>', $patch['uniqueName'], $e->getMessage() |
|
| 73 | + )); |
|
| 74 | + throw $e; |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | - if ($count) { |
|
| 78 | - $output->writeln(sprintf( |
|
| 79 | - '<info>%d</info> patches successfully applied', $count |
|
| 80 | - )); |
|
| 81 | - } else { |
|
| 82 | - $output->writeln('<info>No patches to apply</info>'); |
|
| 83 | - } |
|
| 84 | - } |
|
| 77 | + if ($count) { |
|
| 78 | + $output->writeln(sprintf( |
|
| 79 | + '<info>%d</info> patches successfully applied', $count |
|
| 80 | + )); |
|
| 81 | + } else { |
|
| 82 | + $output->writeln('<info>No patches to apply</info>'); |
|
| 83 | + } |
|
| 84 | + } |
|
| 85 | 85 | } |
@@ -19,7 +19,6 @@ discard block |
||
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * The controller to track which patchs have been applied. |
| 22 | - |
|
| 23 | 22 | */ |
| 24 | 23 | class PatchController extends AbstractMoufInstanceController { |
| 25 | 24 | |
@@ -97,87 +96,87 @@ discard block |
||
| 97 | 96 | header('Location: .?name='.urlencode($name)); |
| 98 | 97 | } |
| 99 | 98 | |
| 100 | - /** |
|
| 101 | - * Displays the page to select the patch types to be applied. |
|
| 102 | - * |
|
| 103 | - * @Action |
|
| 104 | - * @Logged |
|
| 105 | - * @param string $name |
|
| 106 | - * @param string $selfedit |
|
| 107 | - */ |
|
| 108 | - public function runAllPatches($name, $selfedit) { |
|
| 109 | - $this->initController($name, $selfedit); |
|
| 110 | - |
|
| 111 | - $patchService = new InstanceProxy($name, $selfedit == "true"); |
|
| 112 | - $this->patchesArray = $patchService->getView(); |
|
| 113 | - |
|
| 114 | - $types = $patchService->_getSerializedTypes(); |
|
| 115 | - |
|
| 116 | - foreach ($types as $type) { |
|
| 117 | - $this->nbPatchesByType[$type['name']] = 0; |
|
| 118 | - } |
|
| 119 | - |
|
| 120 | - $nbNoneDefaultPatches = 0; |
|
| 121 | - |
|
| 122 | - foreach ($this->patchesArray as $patch) { |
|
| 123 | - if ($patch['status'] == PatchInterface::STATUS_AWAITING || $patch['status'] == PatchInterface::STATUS_ERROR) { |
|
| 124 | - $type = $patch['patch_type']; |
|
| 125 | - if ($type !== '') { |
|
| 126 | - $nbNoneDefaultPatches++; |
|
| 127 | - } |
|
| 128 | - $this->nbPatchesByType[$type]++; |
|
| 129 | - } |
|
| 130 | - } |
|
| 131 | - |
|
| 132 | - // If all patches to be applied are default patches, let's do this right now. |
|
| 133 | - if ($nbNoneDefaultPatches === 0) { |
|
| 134 | - $this->applyAllPatches($name, [''], $selfedit); |
|
| 135 | - return; |
|
| 136 | - } |
|
| 137 | - |
|
| 138 | - ksort($this->nbPatchesByType); |
|
| 139 | - |
|
| 140 | - // Otherwise, let's display a screen to select the patch types to be applied. |
|
| 141 | - $this->content->addFile(__DIR__."/../../../../views/applyPatches.php", $this); |
|
| 142 | - $this->template->toHtml(); |
|
| 143 | - } |
|
| 144 | - |
|
| 145 | - |
|
| 146 | - /** |
|
| 147 | - * Runs all patches in a row. |
|
| 148 | - * |
|
| 149 | - * @Action |
|
| 150 | - * @Logged |
|
| 151 | - * @param string $name |
|
| 152 | - * @param array $types |
|
| 153 | - * @param string $selfedit |
|
| 154 | - */ |
|
| 99 | + /** |
|
| 100 | + * Displays the page to select the patch types to be applied. |
|
| 101 | + * |
|
| 102 | + * @Action |
|
| 103 | + * @Logged |
|
| 104 | + * @param string $name |
|
| 105 | + * @param string $selfedit |
|
| 106 | + */ |
|
| 107 | + public function runAllPatches($name, $selfedit) { |
|
| 108 | + $this->initController($name, $selfedit); |
|
| 109 | + |
|
| 110 | + $patchService = new InstanceProxy($name, $selfedit == "true"); |
|
| 111 | + $this->patchesArray = $patchService->getView(); |
|
| 112 | + |
|
| 113 | + $types = $patchService->_getSerializedTypes(); |
|
| 114 | + |
|
| 115 | + foreach ($types as $type) { |
|
| 116 | + $this->nbPatchesByType[$type['name']] = 0; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + $nbNoneDefaultPatches = 0; |
|
| 120 | + |
|
| 121 | + foreach ($this->patchesArray as $patch) { |
|
| 122 | + if ($patch['status'] == PatchInterface::STATUS_AWAITING || $patch['status'] == PatchInterface::STATUS_ERROR) { |
|
| 123 | + $type = $patch['patch_type']; |
|
| 124 | + if ($type !== '') { |
|
| 125 | + $nbNoneDefaultPatches++; |
|
| 126 | + } |
|
| 127 | + $this->nbPatchesByType[$type]++; |
|
| 128 | + } |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + // If all patches to be applied are default patches, let's do this right now. |
|
| 132 | + if ($nbNoneDefaultPatches === 0) { |
|
| 133 | + $this->applyAllPatches($name, [''], $selfedit); |
|
| 134 | + return; |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + ksort($this->nbPatchesByType); |
|
| 138 | + |
|
| 139 | + // Otherwise, let's display a screen to select the patch types to be applied. |
|
| 140 | + $this->content->addFile(__DIR__."/../../../../views/applyPatches.php", $this); |
|
| 141 | + $this->template->toHtml(); |
|
| 142 | + } |
|
| 143 | + |
|
| 144 | + |
|
| 145 | + /** |
|
| 146 | + * Runs all patches in a row. |
|
| 147 | + * |
|
| 148 | + * @Action |
|
| 149 | + * @Logged |
|
| 150 | + * @param string $name |
|
| 151 | + * @param array $types |
|
| 152 | + * @param string $selfedit |
|
| 153 | + */ |
|
| 155 | 154 | public function applyAllPatches($name, array $types, $selfedit) { |
| 156 | 155 | $patchService = new InstanceProxy($name, $selfedit == "true"); |
| 157 | 156 | $this->patchesArray = $patchService->getView(); |
| 158 | 157 | |
| 159 | 158 | // Array of cound of applied and skip patched. Key is the patch type. |
| 160 | 159 | $appliedPatchArray = []; |
| 161 | - $skippedPatchArray = []; |
|
| 160 | + $skippedPatchArray = []; |
|
| 162 | 161 | |
| 163 | 162 | try { |
| 164 | 163 | foreach ($this->patchesArray as $patch) { |
| 165 | - if ($patch['status'] == PatchInterface::STATUS_AWAITING || $patch['status'] == PatchInterface::STATUS_ERROR) { |
|
| 166 | - $type = $patch['patch_type']; |
|
| 167 | - if (in_array($type, $types) || $type === '') { |
|
| 168 | - $patchService->apply($patch['uniqueName']); |
|
| 169 | - if (!isset($appliedPatchArray[$type])) { |
|
| 170 | - $appliedPatchArray[$type] = 0; |
|
| 171 | - } |
|
| 172 | - $appliedPatchArray[$type]++; |
|
| 173 | - } else { |
|
| 174 | - $patchService->skip($patch['uniqueName']); |
|
| 175 | - if (!isset($skippedPatchArray[$type])) { |
|
| 176 | - $skippedPatchArray[$type] = 0; |
|
| 177 | - } |
|
| 178 | - $skippedPatchArray[$type]++; |
|
| 179 | - } |
|
| 180 | - } |
|
| 164 | + if ($patch['status'] == PatchInterface::STATUS_AWAITING || $patch['status'] == PatchInterface::STATUS_ERROR) { |
|
| 165 | + $type = $patch['patch_type']; |
|
| 166 | + if (in_array($type, $types) || $type === '') { |
|
| 167 | + $patchService->apply($patch['uniqueName']); |
|
| 168 | + if (!isset($appliedPatchArray[$type])) { |
|
| 169 | + $appliedPatchArray[$type] = 0; |
|
| 170 | + } |
|
| 171 | + $appliedPatchArray[$type]++; |
|
| 172 | + } else { |
|
| 173 | + $patchService->skip($patch['uniqueName']); |
|
| 174 | + if (!isset($skippedPatchArray[$type])) { |
|
| 175 | + $skippedPatchArray[$type] = 0; |
|
| 176 | + } |
|
| 177 | + $skippedPatchArray[$type]++; |
|
| 178 | + } |
|
| 179 | + } |
|
| 181 | 180 | } |
| 182 | 181 | |
| 183 | 182 | } catch (\Exception $e) { |
@@ -185,37 +184,37 @@ discard block |
||
| 185 | 184 | set_user_message($htmlMessage); |
| 186 | 185 | } |
| 187 | 186 | |
| 188 | - $this->displayNotificationMessage($appliedPatchArray, $skippedPatchArray); |
|
| 187 | + $this->displayNotificationMessage($appliedPatchArray, $skippedPatchArray); |
|
| 189 | 188 | |
| 190 | - header('Location: .?name='.urlencode($name)); |
|
| 189 | + header('Location: .?name='.urlencode($name)); |
|
| 191 | 190 | } |
| 192 | 191 | |
| 193 | 192 | private function displayNotificationMessage(array $appliedPatchArray, array $skippedPatchArray) |
| 194 | - { |
|
| 195 | - $nbPatchesApplied = array_sum($appliedPatchArray); |
|
| 196 | - $nbPatchesSkipped = array_sum($skippedPatchArray); |
|
| 197 | - $msg = ''; |
|
| 198 | - if ($nbPatchesApplied !== 0) { |
|
| 199 | - $patchArr = []; |
|
| 200 | - foreach ($appliedPatchArray as $name => $number) { |
|
| 201 | - $name = $name ?: 'default'; |
|
| 202 | - $patchArr[] = plainstring_to_htmlprotected($name).': '.$number; |
|
| 203 | - } |
|
| 204 | - |
|
| 205 | - $msg .= sprintf('%d patch(es) applied (%s)', $nbPatchesApplied, implode(', ', $patchArr)); |
|
| 206 | - } |
|
| 207 | - if ($nbPatchesSkipped !== 0) { |
|
| 208 | - $patchArr = []; |
|
| 209 | - foreach ($skippedPatchArray as $name => $number) { |
|
| 210 | - $name = $name ?: 'default'; |
|
| 211 | - $patchArr[] = plainstring_to_htmlprotected($name).': '.$number; |
|
| 212 | - } |
|
| 213 | - |
|
| 214 | - $msg .= sprintf('%d patch(es) skipped (%s)', $nbPatchesSkipped, implode(', ', $patchArr)); |
|
| 215 | - } |
|
| 216 | - |
|
| 217 | - if ($msg !== '') { |
|
| 218 | - set_user_message($msg, UserMessageInterface::SUCCESS); |
|
| 219 | - } |
|
| 220 | - } |
|
| 193 | + { |
|
| 194 | + $nbPatchesApplied = array_sum($appliedPatchArray); |
|
| 195 | + $nbPatchesSkipped = array_sum($skippedPatchArray); |
|
| 196 | + $msg = ''; |
|
| 197 | + if ($nbPatchesApplied !== 0) { |
|
| 198 | + $patchArr = []; |
|
| 199 | + foreach ($appliedPatchArray as $name => $number) { |
|
| 200 | + $name = $name ?: 'default'; |
|
| 201 | + $patchArr[] = plainstring_to_htmlprotected($name).': '.$number; |
|
| 202 | + } |
|
| 203 | + |
|
| 204 | + $msg .= sprintf('%d patch(es) applied (%s)', $nbPatchesApplied, implode(', ', $patchArr)); |
|
| 205 | + } |
|
| 206 | + if ($nbPatchesSkipped !== 0) { |
|
| 207 | + $patchArr = []; |
|
| 208 | + foreach ($skippedPatchArray as $name => $number) { |
|
| 209 | + $name = $name ?: 'default'; |
|
| 210 | + $patchArr[] = plainstring_to_htmlprotected($name).': '.$number; |
|
| 211 | + } |
|
| 212 | + |
|
| 213 | + $msg .= sprintf('%d patch(es) skipped (%s)', $nbPatchesSkipped, implode(', ', $patchArr)); |
|
| 214 | + } |
|
| 215 | + |
|
| 216 | + if ($msg !== '') { |
|
| 217 | + set_user_message($msg, UserMessageInterface::SUCCESS); |
|
| 218 | + } |
|
| 219 | + } |
|
| 221 | 220 | } |
| 222 | 221 | \ No newline at end of file |
@@ -19,53 +19,53 @@ |
||
| 19 | 19 | |
| 20 | 20 | class PatchInstaller2 implements PackageInstallerInterface |
| 21 | 21 | { |
| 22 | - /** |
|
| 23 | - * (non-PHPdoc) |
|
| 24 | - * @see \Mouf\Installer\PackageInstallerInterface::install() |
|
| 25 | - * @param MoufManager $moufManager |
|
| 26 | - * @throws \Mouf\MoufException |
|
| 27 | - */ |
|
| 28 | - public static function install(MoufManager $moufManager) |
|
| 29 | - { |
|
| 30 | - // Let's create the instance. |
|
| 31 | - $patchDefaultType = InstallUtils::getOrCreateInstance('patch.default_type', PatchType::class, $moufManager); |
|
| 32 | - $patchDefaultType->getConstructorArgumentProperty('name')->setValue(''); |
|
| 33 | - $patchDefaultType->getConstructorArgumentProperty('description')->setValue('Patches that should be always applied should have this type. Typically, use this type for DDL changes or reference data insertion.'); |
|
| 22 | + /** |
|
| 23 | + * (non-PHPdoc) |
|
| 24 | + * @see \Mouf\Installer\PackageInstallerInterface::install() |
|
| 25 | + * @param MoufManager $moufManager |
|
| 26 | + * @throws \Mouf\MoufException |
|
| 27 | + */ |
|
| 28 | + public static function install(MoufManager $moufManager) |
|
| 29 | + { |
|
| 30 | + // Let's create the instance. |
|
| 31 | + $patchDefaultType = InstallUtils::getOrCreateInstance('patch.default_type', PatchType::class, $moufManager); |
|
| 32 | + $patchDefaultType->getConstructorArgumentProperty('name')->setValue(''); |
|
| 33 | + $patchDefaultType->getConstructorArgumentProperty('description')->setValue('Patches that should be always applied should have this type. Typically, use this type for DDL changes or reference data insertion.'); |
|
| 34 | 34 | |
| 35 | - $patchTestDataType = InstallUtils::getOrCreateInstance('patch.testdata_type', PatchType::class, $moufManager); |
|
| 36 | - $patchTestDataType->getConstructorArgumentProperty('name')->setValue('test_data'); |
|
| 37 | - $patchTestDataType->getConstructorArgumentProperty('description')->setValue('Use this type to mark patches that contain test data that should only be used in staging environment.'); |
|
| 35 | + $patchTestDataType = InstallUtils::getOrCreateInstance('patch.testdata_type', PatchType::class, $moufManager); |
|
| 36 | + $patchTestDataType->getConstructorArgumentProperty('name')->setValue('test_data'); |
|
| 37 | + $patchTestDataType->getConstructorArgumentProperty('description')->setValue('Use this type to mark patches that contain test data that should only be used in staging environment.'); |
|
| 38 | 38 | |
| 39 | - $patchService = InstallUtils::getOrCreateInstance('patchService', PatchService::class, $moufManager); |
|
| 39 | + $patchService = InstallUtils::getOrCreateInstance('patchService', PatchService::class, $moufManager); |
|
| 40 | 40 | |
| 41 | - if (empty($patchService->getConstructorArgumentProperty('types')->getValue())) { |
|
| 42 | - $patchService->getConstructorArgumentProperty('types')->setValue([ $patchDefaultType, $patchTestDataType ]); |
|
| 43 | - } |
|
| 41 | + if (empty($patchService->getConstructorArgumentProperty('types')->getValue())) { |
|
| 42 | + $patchService->getConstructorArgumentProperty('types')->setValue([ $patchDefaultType, $patchTestDataType ]); |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - $consoleUtils = new ConsoleUtils($moufManager); |
|
| 45 | + $consoleUtils = new ConsoleUtils($moufManager); |
|
| 46 | 46 | |
| 47 | - $listPatchesCommand = $moufManager->createInstance(ListPatchesCommand::class); |
|
| 48 | - $listPatchesCommand->getConstructorArgumentProperty("patchService")->setValue($patchService); |
|
| 49 | - $consoleUtils->registerCommand($listPatchesCommand); |
|
| 47 | + $listPatchesCommand = $moufManager->createInstance(ListPatchesCommand::class); |
|
| 48 | + $listPatchesCommand->getConstructorArgumentProperty("patchService")->setValue($patchService); |
|
| 49 | + $consoleUtils->registerCommand($listPatchesCommand); |
|
| 50 | 50 | |
| 51 | - $applyAllPatchesCommand = $moufManager->createInstance(ApplyAllPatchesCommand::class); |
|
| 52 | - $applyAllPatchesCommand->getConstructorArgumentProperty("patchService")->setValue($patchService); |
|
| 53 | - $consoleUtils->registerCommand($applyAllPatchesCommand); |
|
| 51 | + $applyAllPatchesCommand = $moufManager->createInstance(ApplyAllPatchesCommand::class); |
|
| 52 | + $applyAllPatchesCommand->getConstructorArgumentProperty("patchService")->setValue($patchService); |
|
| 53 | + $consoleUtils->registerCommand($applyAllPatchesCommand); |
|
| 54 | 54 | |
| 55 | - $applyPatchCommand = $moufManager->createInstance(ApplyPatchCommand::class); |
|
| 56 | - $applyPatchCommand->getConstructorArgumentProperty("patchService")->setValue($patchService); |
|
| 57 | - $consoleUtils->registerCommand($applyPatchCommand); |
|
| 55 | + $applyPatchCommand = $moufManager->createInstance(ApplyPatchCommand::class); |
|
| 56 | + $applyPatchCommand->getConstructorArgumentProperty("patchService")->setValue($patchService); |
|
| 57 | + $consoleUtils->registerCommand($applyPatchCommand); |
|
| 58 | 58 | |
| 59 | - $skipPatchCommand = $moufManager->createInstance(SkipPatchCommand::class); |
|
| 60 | - $skipPatchCommand->getConstructorArgumentProperty("patchService")->setValue($patchService); |
|
| 61 | - $consoleUtils->registerCommand($skipPatchCommand); |
|
| 59 | + $skipPatchCommand = $moufManager->createInstance(SkipPatchCommand::class); |
|
| 60 | + $skipPatchCommand->getConstructorArgumentProperty("patchService")->setValue($patchService); |
|
| 61 | + $consoleUtils->registerCommand($skipPatchCommand); |
|
| 62 | 62 | |
| 63 | - $revertPatchCommand = $moufManager->createInstance(RevertPatchCommand::class); |
|
| 64 | - $revertPatchCommand->getConstructorArgumentProperty("patchService")->setValue($patchService); |
|
| 65 | - $consoleUtils->registerCommand($revertPatchCommand); |
|
| 63 | + $revertPatchCommand = $moufManager->createInstance(RevertPatchCommand::class); |
|
| 64 | + $revertPatchCommand->getConstructorArgumentProperty("patchService")->setValue($patchService); |
|
| 65 | + $consoleUtils->registerCommand($revertPatchCommand); |
|
| 66 | 66 | |
| 67 | 67 | |
| 68 | - // Let's rewrite the MoufComponents.php file to save the component |
|
| 69 | - $moufManager->rewriteMouf(); |
|
| 70 | - } |
|
| 68 | + // Let's rewrite the MoufComponents.php file to save the component |
|
| 69 | + $moufManager->rewriteMouf(); |
|
| 70 | + } |
|
| 71 | 71 | } |