Skip to content

Commit a7cc636

Browse files
committed
Basically works, need to refactor options
1 parent a7e711f commit a7cc636

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@
99

1010
abstract class BaseCommand extends Command
1111
{
12+
/**
13+
* @return PHPCR\SessionInterface
14+
*/
1215
protected function getPhpcrSession()
1316
{
1417
return $this->getHelper('phpcr')->getSession();
1518
}
1619

20+
/**
21+
* @return PHPCR\Util\Console\Helper\PhpcrCliHelper
22+
*/
1723
protected function getPhpcrCliHelper()
1824
{
1925
$phpcrCliHelper = new PhpcrCliHelper($this->getPhpcrSession());

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
111111
$noInteraction = $input->getOption('no-interaction');
112112
$helper = $this->getPhpcrCliHelper();
113113
$session = $this->getPhpcrSession();
114+
114115
$this->dialog = new DialogHelper();
115116

116117
if (!$type) {
@@ -153,6 +154,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
153154
));
154155
}
155156

157+
$session->save();
158+
156159
$output->writeln(sprintf('<info>%.2f seconds</info>', $elapsed));
157160

158161
return 0;

src/PHPCR/Util/Console/Helper/PhpcrCliHelper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,19 @@ public function processNode(OutputInterface $output, $node, $options)
9898
}
9999

100100
foreach ($options['addMixins'] as $addMixin) {
101-
$output->writeln(
101+
$output->writeln(sprintf(
102102
'<comment> > Adding mixin </comment>%s<comment>',
103103
$addMixin
104-
);
104+
));
105105

106106
$node->addMixin($addMixin);
107107
}
108108

109109
foreach ($options['removeMixins'] as $removeMixin) {
110-
$output->writeln(
110+
$output->writeln(sprintf(
111111
'<comment> > Removing mixin </comment>%s<comment>',
112112
$removeMixin
113-
);
113+
));
114114

115115
$node->removeMixin($removeMixin);
116116
}

0 commit comments

Comments
 (0)