Skip to content

Commit d0e8e6e

Browse files
committed
query argument now mandastory for query command
1 parent 82a9d0a commit d0e8e6e

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dev-master
1818
- [node:remove] Cannot `node:remove` by UUID
1919
- [node:edit] Serialization of single value references doesn't work
2020
- [file:import] Irregular files are accepted
21+
- [query] Possible to try and execute query without a query
2122

2223
### Enhancements
2324

composer.json

+3
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
"email": "[email protected]"
3737
}
3838
],
39+
"conflict": {
40+
"doctrine/phpcr-bundle": "<=1.2.1"
41+
},
3942
"autoload": {
4043
"psr-0": {"": "src"}
4144
},

features/all/phpcr_query.feature

+4
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ Feature: Execute a query
2929
Scenario: Execute query with language
3030
Given I execute the "query '/jcr:root/nodes' --language=xpath" command
3131
Then the command should not fail
32+
33+
Scenario: Execute query with no query
34+
Given I execute the "query --language=xpath" command
35+
Then the command should fail

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@
1515
use Symfony\Component\Console\Input\InputInterface;
1616
use Symfony\Component\Console\Input\InputOption;
1717
use Symfony\Component\Console\Output\OutputInterface;
18+
use Symfony\Component\Console\Input\InputArgument;
1819

1920
class QueryCommand extends BasePhpcrCommand
2021
{
2122
protected function configure()
2223
{
2324
$this->setName('query');
2425
$this->setDescription('Execute a SELECT query (advanced)');
25-
$this->addArgument('query');
26+
$this->addArgument('query', InputArgument::REQUIRED, 'Query to execute');
2627
$this->addOption('language', 'l', InputOption::VALUE_OPTIONAL, 'The query language (e.g. jcr-sql2', 'JCR-SQL2');
2728
$this->addOption('limit', null, InputOption::VALUE_OPTIONAL, 'The query limit', 0);
2829
$this->addOption('offset', null, InputOption::VALUE_OPTIONAL, 'The query offset', 0);

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

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function execute(InputInterface $input, OutputInterface $output)
8585
$updates = $res->offsetGet(1);
8686
$applies = $res->offsetGet(3);
8787

88+
8889
$start = microtime(true);
8990
$result = $query->execute();
9091
$rows = 0;

0 commit comments

Comments
 (0)