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
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
use Symfony\Component\Console\Input\InputArgument;
99
use PHPCR\SimpleCredentials;
1010

11-
class SessionImpersonateCommand extends Command
11+
class SessionImpersonateCommand extends PhpcrShellCommand
1212
{
1313
protected function configure()
1414
{
1515
$this->setName('session:impersonate');
16-
$this->setDescription('Impersonate the given user NOT SUPPORTED');
16+
$this->setDescription('Impersonate the given user');
1717
$this->addArgument('username', InputArgument::REQUIRED, 'Username of user to impersonate');
1818
$this->setHelp(<<<HERE
1919
Note: This command is not implemented by any of the transports currently.
@@ -35,6 +35,8 @@ protected function configure()
3535
Session.
3636
HERE
3737
);
38+
39+
$this->dequiresDescriptor('jackalope.not_implemented.session.impersonate');
3840
}
3941

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SessionImportXMLCommand extends Command
2121
protected function configure()
2222
{
2323
$this->setName('session:import-xml');
24-
$this->setDescription('Export the system view');
24+
$this->setDescription('Import content from an XML file');
2525
$this->addArgument('parentAbsPath', InputArgument::REQUIRED, 'Path of node to export');
2626
$this->addArgument('file', InputArgument::REQUIRED, 'File to export to');
2727
$this->addOption('uuid-behavior', null, InputOption::VALUE_REQUIRED, 'UUID behavior', 'create-new');

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class WorkspaceDeleteCommand extends Command
1212
protected function configure()
1313
{
1414
$this->setName('workspace:delete');
15-
$this->setDescription('Delete a new workspace');
15+
$this->setDescription('Delete a workspace');
1616
$this->addArgument('name', InputArgument::REQUIRED, 'Name of new workspace');
1717
$this->addArgument('srcWorkspace', InputArgument::OPTIONAL, 'If specified, clone from this workspace');
1818
$this->setHelp(<<<HERE

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class WorkspaceNamespaceUnregisterCommand extends Command
1212
protected function configure()
1313
{
1414
$this->setName('workspace:namespace:unregister');
15-
$this->setDescription('Sets a one-to-one mapping between prefix and uri in the global namespace');
15+
$this->setDescription('Unregister a namespace');
1616
$this->addArgument('uri', null, InputArgument::REQUIRED, 'The URI to be removed');
1717
$this->setHelp(<<<HERE
1818
Removes the specified namespace URI from namespace registry.

tests/PHPCR/Shell/Helper/RepositoryHelperTest.php

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

0 commit comments

Comments
 (0)