Skip to content

Commit ab72f51

Browse files
committed
Add version commands only if supported
1 parent a66249d commit ab72f51

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckinCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Symfony\Component\Console\Input\InputInterface;
77
use Symfony\Component\Console\Output\OutputInterface;
88
use Symfony\Component\Console\Input\InputArgument;
9+
use PHPCR\RepositoryInterface;
910

1011
class VersionCheckinCommand extends BasePhpcrCommand
1112
{
@@ -42,7 +43,9 @@ protected function configure()
4243
If checkin succeeds, the change to the <comment>jcr:isCheckedOut</comment> property is
4344
dispatched immediately.
4445
HERE
45-
);
46+
);
47+
48+
$this->requiresDescriptor(RepositoryInterface::OPTION_VERSIONING_SUPPORTED, true);
4649
}
4750

4851
public function execute(InputInterface $input, OutputInterface $output)

src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckoutCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Symfony\Component\Console\Input\InputInterface;
77
use Symfony\Component\Console\Output\OutputInterface;
88
use Symfony\Component\Console\Input\InputArgument;
9+
use PHPCR\RepositoryInterface;
910

1011
class VersionCheckoutCommand extends BasePhpcrCommand
1112
{
@@ -31,6 +32,7 @@ protected function configure()
3132
If this node is already checked-out, this method has no effect.
3233
HERE
3334
);
35+
$this->requiresDescriptor(RepositoryInterface::OPTION_VERSIONING_SUPPORTED, true);
3436
}
3537

3638
public function execute(InputInterface $input, OutputInterface $output)

src/PHPCR/Shell/Console/Command/Phpcr/VersionCheckpointCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Symfony\Component\Console\Input\InputInterface;
77
use Symfony\Component\Console\Output\OutputInterface;
88
use Symfony\Component\Console\Input\InputArgument;
9+
use PHPCR\RepositoryInterface;
910

1011
class VersionCheckpointCommand extends BasePhpcrCommand
1112
{
@@ -21,6 +22,7 @@ protected function configure()
2122
If this node is already checked-in, this method is equivalent to <info>version:checkout</info>.
2223
HERE
2324
);
25+
$this->requiresDescriptor(RepositoryInterface::OPTION_VERSIONING_SUPPORTED, true);
2426
}
2527

2628
public function execute(InputInterface $input, OutputInterface $output)

src/PHPCR/Shell/Console/Command/Phpcr/VersionHistoryCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Symfony\Component\Console\Input\InputInterface;
77
use Symfony\Component\Console\Output\OutputInterface;
88
use Symfony\Component\Console\Input\InputArgument;
9+
use PHPCR\RepositoryInterface;
910

1011
class VersionHistoryCommand extends BasePhpcrCommand
1112
{
@@ -18,6 +19,7 @@ protected function configure()
1819
Lists the version history of the node given at <info>path</info>.
1920
HERE
2021
);
22+
$this->requiresDescriptor(RepositoryInterface::OPTION_VERSIONING_SUPPORTED, true);
2123
}
2224

2325
public function execute(InputInterface $input, OutputInterface $output)

src/PHPCR/Shell/Console/Command/Phpcr/VersionRemoveCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Symfony\Component\Console\Input\InputInterface;
77
use Symfony\Component\Console\Output\OutputInterface;
88
use Symfony\Component\Console\Input\InputArgument;
9+
use PHPCR\RepositoryInterface;
910

1011
class VersionRemoveCommand extends BasePhpcrCommand
1112
{
@@ -33,6 +34,7 @@ protected function configure()
3334
this context.
3435
HERE
3536
);
37+
$this->requiresDescriptor(RepositoryInterface::OPTION_VERSIONING_SUPPORTED, true);
3638
}
3739

3840
public function execute(InputInterface $input, OutputInterface $output)

src/PHPCR/Shell/Console/Command/Phpcr/VersionRestoreCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Symfony\Component\Console\Output\OutputInterface;
88
use Symfony\Component\Console\Input\InputArgument;
99
use Symfony\Component\Console\Input\InputOption;
10+
use PHPCR\RepositoryInterface;
1011

1112
class VersionRestoreCommand extends BasePhpcrCommand
1213
{
@@ -89,6 +90,7 @@ protected function configure()
8990
signatures, you need to act accordingly in your implementation.
9091
HERE
9192
);
93+
$this->requiresDescriptor(RepositoryInterface::OPTION_VERSIONING_SUPPORTED, true);
9294
}
9395

9496
public function execute(InputInterface $input, OutputInterface $output)

0 commit comments

Comments
 (0)