Skip to content

Commit 1c61cb5

Browse files
committed
Updated all names
1 parent 44b76ea commit 1c61cb5

13 files changed

+134
-32
lines changed

bin/phpcr

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ $cli = new \Symfony\Component\Console\Application('PHPCR Command Line Interface'
4040
$cli->setCatchExceptions(true);
4141
$cli->setHelperSet($helperSet);
4242
$cli->addCommands(array(
43-
new \PHPCR\Util\Console\Command\CreateWorkspaceCommand(),
44-
new \PHPCR\Util\Console\Command\ImportXmlCommand(),
45-
new \PHPCR\Util\Console\Command\DumpCommand(),
46-
new \PHPCR\Util\Console\Command\PurgeCommand(),
47-
new \PHPCR\Util\Console\Command\RegisterNodeTypesCommand(),
48-
new \PHPCR\Util\Console\Command\ListNodeTypesCommand(),
49-
new \PHPCR\Util\Console\Command\QueryCommand(),
50-
new \PHPCR\Util\Console\Command\MoveCommand(),
51-
new \PHPCR\Util\Console\Command\TouchCommand(),
43+
new \PHPCR\Util\Console\Command\NodeDumpCommand(),
44+
new \PHPCR\Util\Console\Command\NodeMoveCommand(),
45+
new \PHPCR\Util\Console\Command\NodeRemoveCommand(),
46+
new \PHPCR\Util\Console\Command\NodeTouchCommand(),
47+
new \PHPCR\Util\Console\Command\NodeTypeListCommand(),
48+
new \PHPCR\Util\Console\Command\NodeTypeRegisterCommand(),
49+
new \PHPCR\Util\Console\Command\WorkspaceCreateCommand(),
50+
new \PHPCR\Util\Console\Command\WorkspaceExportCommand(),
51+
new \PHPCR\Util\Console\Command\WorkspaceImportCommand(),
52+
new \PHPCR\Util\Console\Command\WorkspacePurgeCommand(),
53+
new \PHPCR\Util\Console\Command\WorkspaceQueryCommand(),
5254
));
5355
$cli->run();
5456

src/PHPCR/Util/Console/Command/WorkspaceDumpCommand.php renamed to src/PHPCR/Util/Console/Command/NodeDumpCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* @author Daniel Barsotti <daniel.barsotti@liip.ch>
4343
*/
44-
class DumpCommand extends Command
44+
class NodeDumpCommand extends Command
4545
{
4646
/**
4747
* Limit after which to cut lines when dumping properties
@@ -56,7 +56,7 @@ class DumpCommand extends Command
5656
protected function configure()
5757
{
5858
$this
59-
->setName('phpcr:dump')
59+
->setName('phpcr:node:dump')
6060
->addOption('sys_nodes', null, InputOption::VALUE_NONE, 'Use to dump the system nodes')
6161
->addOption('props', null, InputOption::VALUE_NONE, 'Use to dump the node properties')
6262
->addOption('depth', null, InputOption::VALUE_OPTIONAL, 'Set to a number to limit how deep into the tree to recurse', "-1")

src/PHPCR/Util/Console/Command/NodeMoveCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
*
3232
* @author Daniel Leech <daniel@dantleech.com>
3333
*/
34-
class MoveCommand extends Command
34+
class NodeMoveCommand extends Command
3535
{
3636
/**
3737
* {@inheritDoc}
3838
*/
3939
protected function configure()
4040
{
4141
$this
42-
->setName('phpcr:move')
42+
->setName('phpcr:node:move')
4343
->addArgument('source', InputArgument::REQUIRED, 'Path of node to move')
4444
->addArgument('destination', InputArgument::REQUIRED, 'Destination for node')
4545
->setDescription('Moves a node from one path to another')

src/PHPCR/Util/Console/Command/NodeRemoveCommand.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*
3737
* @author Daniel Barsotti <daniel.barsotti@liip.ch>
3838
*/
39-
class PurgeCommand extends Command
39+
class NodeRemoveCommand extends Command
4040
{
4141
/**
4242
* {@inheritDoc}
@@ -46,13 +46,22 @@ protected function configure()
4646
parent::configure();
4747

4848
$this
49-
->setName('phpcr:purge')
49+
->setName('phpcr:node:remove')
5050
->setDescription('Remove content from the repository')
5151
->addArgument('path', InputArgument::OPTIONAL, 'Path of the node to purge', '/')
5252
->addOption('force', null, InputOption::VALUE_NONE, 'Use to bypass the confirmation dialog')
5353
->addOption('only-children', null, InputOption::VALUE_NONE, 'Use to only purge children of specified path')
5454
->setHelp(<<<EOF
55-
The <info>phpcr:purge</info> command remove all the non-standard nodes from the content repository
55+
The <info>phpcr:node:remove</info> command will remove the given node or the
56+
children of the given node according to the options given.
57+
58+
Remove specified node and its children:
59+
60+
$ php bin/phpcr phpcr:node:remove /cms/content/blog
61+
62+
Remove only the children of the specified node
63+
64+
$ php bin/phpcr phpcr:node:remove /cms/content/blog --only-children
5665
EOF
5766
)
5867
;
@@ -89,7 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8998
}
9099

91100
if ($force) {
92-
$message = '<comment>></comment> <info>Purging: </info> %s';
101+
$message = '<comment>></comment> <info>Purging: </info>%s';
93102

94103
if ($onlyChildren) {
95104
$baseNode = $session->getNode($path, 0);
@@ -102,7 +111,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
102111
$output->writeln(sprintf($message, $path));
103112

104113
if ('/' === $path) {
105-
NodeHelper::purgeWorkspace($this->getHelper('phpcr')->getSession());
114+
throw new \Exception(
115+
'Will not purge path entire workspace ("/"), use the '.
116+
'workspace:purge method instead.'
117+
);
106118
} else {
107119
$session->removeItem($path);
108120
}

src/PHPCR/Util/Console/Command/NodeTouchCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
* @author Daniel Leech <daniel@dantleech.com>
3636
*/
37-
class TouchCommand extends Command
37+
class NodeTouchCommand extends Command
3838
{
3939
/**
4040
* {@inheritDoc}
@@ -43,7 +43,7 @@ protected function configure()
4343
{
4444
parent::configure();
4545

46-
$this->setName('phpcr:touch')
46+
$this->setName('phpcr:node:touch')
4747
->addArgument(
4848
'path',
4949
InputArgument::REQUIRED,

src/PHPCR/Util/Console/Command/NodeTypeListCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
*
3131
* @author Daniel Leech <daniel@dantleech.com>
3232
*/
33-
class ListNodeTypesCommand extends Command
33+
class NodeTypeListCommand extends Command
3434
{
3535
/**
3636
* {@inheritDoc}
3737
*/
3838
protected function configure()
3939
{
4040
$this
41-
->setName('phpcr:type:list')
41+
->setName('phpcr:node-type:list')
4242
->setDescription('List all available node types in the repository')
4343
->setHelp(<<<EOT
4444
This command lists all of the available node types and their subtypes

src/PHPCR/Util/Console/Command/NodeTypeRegisterCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@
3939
*
4040
* @author Uwe Jäger <uwej711@googlemail.com>
4141
*/
42-
class RegisterNodeTypesCommand extends Command
42+
class NodeTypeRegisterCommand extends Command
4343
{
4444
/**
4545
* {@inheritDoc}
4646
*/
4747
protected function configure()
4848
{
4949
$this
50-
->setName('phpcr:type:register')
50+
->setName('phpcr:node-type:register')
5151
->setDescription('Register node types in the PHPCR repository')
5252
->setDefinition(array(
5353
new InputArgument(

src/PHPCR/Util/Console/Command/WorkspaceCreateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @author Lukas Kahwe Smith <smith@pooteeweet.org>
3333
* @author David Buchmann <david@liip.ch>
3434
*/
35-
class CreateWorkspaceCommand extends Command
35+
class WorkspaceCreateCommand extends Command
3636
{
3737
/**
3838
* {@inheritDoc}

src/PHPCR/Util/Console/Command/WorkspaceExportCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
* @author David Buchmann <david@liip.ch>
3636
*/
37-
class ExportXmlCommand extends Command
37+
class WorkspaceExportCommand extends Command
3838
{
3939
/**
4040
* {@inheritDoc}
@@ -44,7 +44,7 @@ protected function configure()
4444
parent::configure();
4545

4646
$this
47-
->setName('phpcr:export')
47+
->setName('phpcr:workspace:export')
4848
->addArgument('filename', InputArgument::REQUIRED, 'The xml file to export to')
4949
->addOption('path', 'p', InputOption::VALUE_OPTIONAL, 'Path of the node to export', '/')
5050
->addOption('skip_binary', null, InputOption::VALUE_OPTIONAL, 'Set to "yes" to skip binaries', "no")

src/PHPCR/Util/Console/Command/WorkspaceImportCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
* @author David Buchmann <david@liip.ch>
3636
*/
37-
class ImportXmlCommand extends Command
37+
class WorkspaceImportCommand extends Command
3838
{
3939
/**
4040
* {@inheritDoc}
@@ -44,7 +44,7 @@ protected function configure()
4444
parent::configure();
4545

4646
$this
47-
->setName('phpcr:import')
47+
->setName('phpcr:workspace:import')
4848
->addArgument('filename', null, 'The xml file to import')
4949
->addOption('parentpath', 'p', InputOption::VALUE_OPTIONAL, 'Repository path to the parent where to import the file contents', '/')
5050
->setDescription('Import xml data into the repository, either in JCR system view format or arbitrary xml')

0 commit comments

Comments
 (0)