Skip to content

Commit e8514dc

Browse files
committed
More cleaning up
1 parent 932116b commit e8514dc

15 files changed

+32
-150
lines changed

src/PHPCR/Shell/Console/Application/ShellApplication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use PHPCR\Shell\Event\ApplicationInitEvent;
2727
use PHPCR\Shell\Event\PhpcrShellEvents;
2828
use PHPCR\Shell\Subscriber;
29+
use PHPCR\Shell\Console\Command\Phpcr\PhpcrShellCommand;
2930

3031
/**
3132
* Main application for PHPCRSH
@@ -142,7 +143,6 @@ private function registerCommands()
142143
$this->add(new CommandPhpcr\SessionRefreshCommand());
143144
$this->add(new CommandPhpcr\SessionSaveCommand());
144145
$this->add(new CommandPhpcr\QuerySelectCommand());
145-
$this->add(new CommandPhpcr\QueryCommand());
146146
$this->add(new CommandPhpcr\RetentionHoldAddCommand());
147147
$this->add(new CommandPhpcr\RetentionHoldListCommand());
148148
$this->add(new CommandPhpcr\RetentionHoldRemoveCommand());

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,19 @@
22

33
namespace PHPCR\Shell\Console\Command\Phpcr;
44

5-
use Symfony\Component\Console\Command\Command;
65
use Symfony\Component\Console\Input\InputInterface;
6+
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

11-
class AccessControlPrivilegeListCommand extends Command
12+
class AccessControlPrivilegeListCommand extends PhpcrShellCommand
1213
{
1314
protected function configure()
1415
{
1516
$this->setName('access-control:privilege:list');
16-
$this->setDescription('List the privileges of the repository or a specific node NOT IMPLEMENTED');
17+
$this->setDescription('List the privileges of the repository or a specific node');
1718
$this->addArgument('absPath', InputArgument::OPTIONAL, 'Absolute path for node, optional.');
1819
$this->addOption('supported', null, InputOption::VALUE_NONE, 'List privileges supported by repository rather than current session.');
1920
$this->setHelp(<<<HERE
@@ -43,7 +44,9 @@ protected function configure()
4344
list the privileges held by the current session, but rather the privileges
4445
supported by the repository.
4546
HERE
46-
);
47+
);
48+
49+
$this->requiresDescriptor(RepositoryInterface::OPTION_ACCESS_CONTROL_SUPPORTED, true);
4750
}
4851

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class LockInfoCommand extends PhpcrShellCommand
1313
protected function configure()
1414
{
1515
$this->setName('lock:info');
16-
$this->setDescription('Create a node at the current path');
16+
$this->setDescription('Show details of the lock that applies to the specified node path');
1717
$this->addArgument('path', InputArgument::REQUIRED, 'Path of locked node');
1818
$this->setHelp(<<<HERE
1919
Shows the details of the lock that applies to the node at the specified

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class NodeCloneCommand extends Command
1313
protected function configure()
1414
{
1515
$this->setName('node:clone');
16-
$this->setDescription('Copy a node from one workspace to another');
16+
$this->setDescription('Clone a node');
1717
$this->addArgument('srcPath', InputArgument::REQUIRED, 'Path to source node');
1818
$this->addArgument('destPath', InputArgument::REQUIRED, 'Path to destination node');
1919
$this->addArgument('srcWorkspace', InputArgument::OPTIONAL, 'If specified, copy from this workspace');

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,24 @@
22

33
namespace PHPCR\Shell\Console\Command\Phpcr;
44

5-
use Symfony\Component\Console\Command\Command;
65
use Symfony\Component\Console\Input\InputInterface;
76
use Symfony\Component\Console\Output\OutputInterface;
87
use Symfony\Component\Console\Input\InputArgument;
98
use PHPCR\Util\CND\Writer\CndWriter;
109

11-
class NodeDefinitionCommand extends Command
10+
class NodeDefinitionCommand extends PhpcrShellCommand
1211
{
1312
protected function configure()
1413
{
1514
$this->setName('node:definition');
16-
$this->setDescription('Show the CND Definition of current node NOT IMPLEMENTED');
15+
$this->setDescription('Show the CND Definition of current node');
1716
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
1817
$this->setHelp(<<<HERE
1918
Show the CND definition of the primary type of the current node.
2019
HERE
2120
);
21+
22+
$this->dequiresDescriptor('jackalope.not_implemented.node.definition');
2223
}
2324

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class NodeLifecycleFollowCommand extends PhpcrShellCommand
1313
protected function configure()
1414
{
1515
$this->setName('node:lifecycle:follow');
16-
$this->setDescription('Causes the lifecycle state of this node to undergo the specified transition. NOT IMPLEMENTED');
16+
$this->setDescription('Causes the lifecycle state of this node to undergo the specified transition.');
1717
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
1818
$this->addArgument('transition', InputArgument::REQUIRED, 'A state transition');
1919
$this->setHelp(<<<HERE

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class NodeLifecycleListCommand extends PhpcrShellCommand
1313
protected function configure()
1414
{
1515
$this->setName('node:lifecycle:list');
16-
$this->setDescription('Returns the list of valid state transitions for this node. NOT IMPLEMENTED');
16+
$this->setDescription('Returns the list of valid state transitions for this node.');
1717
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
1818
$this->setHelp(<<<HERE
1919
Returns the list of valid state transitions for this node.

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
namespace PHPCR\Shell\Console\Command\Phpcr;
44

5-
use Symfony\Component\Console\Command\Command;
65
use Symfony\Component\Console\Input\InputInterface;
76
use Symfony\Component\Console\Output\OutputInterface;
87
use Symfony\Component\Console\Input\InputArgument;
98

10-
class NodeTypeUnregisterCommand extends Command
9+
class NodeTypeUnregisterCommand extends PhpcrShellCommand
1110
{
1211
protected function configure()
1312
{
@@ -18,6 +17,8 @@ protected function configure()
1817
Unregisters the specified node type
1918
HERE
2019
);
20+
21+
$this->dequiresDescriptor('jackalope.not_implemented.node_type.unregister');
2122
}
2223

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

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

Lines changed: 0 additions & 68 deletions
This file was deleted.

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ class QuerySelectCommand extends Command
1111
protected function configure()
1212
{
1313
$this->setName('select');
14-
$this->setDescription('Execute an SQL query UNSTABLE');
14+
$this->setDescription('Execute an JCR-SQL2 query');
1515
$this->addArgument('query');
1616
$this->setHelp(<<<EOT
17-
This is an unstable feature, see notes for the <info>query</info> command.
17+
Execute a JCR-SQL2 query. Unlike other commands you can enter a query literally:
18+
19+
SELECT * FROM [nt:unstructured];
20+
21+
This command only executes JCR-SQL2 queries at the moment.
1822
EOT
1923
);
2024
}

0 commit comments

Comments
 (0)