Skip to content

Commit

Permalink
adjust to phpcr-utils cli cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu authored and lsmith77 committed Dec 28, 2013
1 parent bcb9892 commit 94f1c5e
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 24 deletions.
14 changes: 10 additions & 4 deletions bin/phpcrodm.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,23 @@
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
$cli->addCommands(array(
new \PHPCR\Util\Console\Command\WorkspaceCreateCommand(),
new \PHPCR\Util\Console\Command\NodeDumpCommand(),
new \PHPCR\Util\Console\Command\NodeMoveCommand(),
new \PHPCR\Util\Console\Command\NodeRemoveCommand(),
new \PHPCR\Util\Console\Command\NodesUpdateCommand(),
new \PHPCR\Util\Console\Command\NodeTouchCommand(),
new \PHPCR\Util\Console\Command\NodeTypeListCommand(),
new \PHPCR\Util\Console\Command\NodeTypeRegisterCommand(),
new \PHPCR\Util\Console\Command\WorkspaceCreateCommand(),
new \PHPCR\Util\Console\Command\WorkspaceDeleteCommand(),
new \PHPCR\Util\Console\Command\WorkspaceExportCommand(),
new \PHPCR\Util\Console\Command\WorkspaceImportCommand(),
new \PHPCR\Util\Console\Command\WorkspaceListCommand(),
new \PHPCR\Util\Console\Command\WorkspacePurgeCommand(),
new \PHPCR\Util\Console\Command\WorkspaceQueryCommand(),
new \PHPCR\Util\Console\Command\NodeTypeRegisterCommand(),
new \Doctrine\ODM\PHPCR\Tools\Console\Command\RegisterSystemNodeTypesCommand(),
new \Doctrine\ODM\PHPCR\Tools\Console\Command\InfoDoctrineCommand(),
new \Doctrine\ODM\PHPCR\Tools\Console\Command\DumpQueryBuilderReferenceCommand(),
new \Doctrine\ODM\PHPCR\Tools\Console\Command\InfoDoctrineCommand(),
new \Doctrine\ODM\PHPCR\Tools\Console\Command\RegisterSystemNodeTypesCommand(),
));
if (isset($extraCommands) && ! empty($extraCommands)) {
$cli->addCommands($extraCommands);
Expand Down
7 changes: 5 additions & 2 deletions cli-config.doctrine_dbal.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ if (isset($argv[1])
$dm = \Doctrine\ODM\PHPCR\DocumentManager::create($session, $config);

$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'dm' => new \Doctrine\ODM\PHPCR\Tools\Console\Helper\DocumentManagerHelper(null, $dm)
'dialog' => new \Symfony\Component\Console\Helper\DialogHelper(),
'phpcr' => new \PHPCR\Util\Console\Helper\PhpcrHelper($session),
'phpcr_console_dumper' => new \PHPCR\Util\Console\Helper\PhpcrConsoleDumperHelper(),
'dm' => new \Doctrine\ODM\PHPCR\Tools\Console\Helper\DocumentManagerHelper(null, $dm),
));
} else if (isset($argv[1]) && $argv[1] == 'jackalope:init:dbal') {
} elseif (isset($argv[1]) && $argv[1] == 'jackalope:init:dbal') {
// special case: the init command needs the db connection, but a session is impossible if the db is not yet initialized
$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'connection' => new \Jackalope\Tools\Console\Helper\DoctrineDbalHelper($dbConn)
Expand Down
5 changes: 4 additions & 1 deletion cli-config.jackrabbit.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ $config->setMetadataDriverImpl($driver);
$dm = \Doctrine\ODM\PHPCR\DocumentManager::create($session, $config);

$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'dm' => new \Doctrine\ODM\PHPCR\Tools\Console\Helper\DocumentManagerHelper(null, $dm)
'dialog' => new \Symfony\Component\Console\Helper\DialogHelper(),
'phpcr' => new \PHPCR\Util\Console\Helper\PhpcrHelper($session),
'phpcr_console_dumper' => new \PHPCR\Util\Console\Helper\PhpcrConsoleDumperHelper(),
'dm' => new \Doctrine\ODM\PHPCR\Tools\Console\Helper\DocumentManagerHelper(null, $dm),
));
5 changes: 4 additions & 1 deletion cli-config.midgard_mysql.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@ $config->setMetadataDriverImpl($driver);
$dm = \Doctrine\ODM\PHPCR\DocumentManager::create($session, $config);

$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'dm' => new \Doctrine\ODM\PHPCR\Tools\Console\Helper\DocumentManagerHelper(null, $dm)
'dialog' => new \Symfony\Component\Console\Helper\DialogHelper(),
'phpcr' => new \PHPCR\Util\Console\Helper\PhpcrHelper($session),
'phpcr_console_dumper' => new \PHPCR\Util\Console\Helper\PhpcrConsoleDumperHelper(),
'dm' => new \Doctrine\ODM\PHPCR\Tools\Console\Helper\DocumentManagerHelper(null, $dm),
));
5 changes: 4 additions & 1 deletion cli-config.midgard_sqlite.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ $config->setMetadataDriverImpl($driver);
$dm = \Doctrine\ODM\PHPCR\DocumentManager::create($session, $config);

$helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
'dm' => new \Doctrine\ODM\PHPCR\Tools\Console\Helper\DocumentManagerHelper(null, $dm)
'dialog' => new \Symfony\Component\Console\Helper\DialogHelper(),
'phpcr' => new \PHPCR\Util\Console\Helper\PhpcrHelper($session),
'phpcr_console_dumper' => new \PHPCR\Util\Console\Helper\PhpcrConsoleDumperHelper(),
'dm' => new \Doctrine\ODM\PHPCR\Tools\Console\Helper\DocumentManagerHelper(null, $dm),
));
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"php": ">=5.3.3",
"doctrine/common": "~2.4.0",
"phpcr/phpcr-implementation": "~2.1.0",
"phpcr/phpcr-utils": "~1.0.0"
"phpcr/phpcr-utils": "~1.1.0"
},
"require-dev": {
"symfony/yaml": "~2.0",
"liip/rmt": "dev-master"
},
"suggest":{
"symfony/yaml": "~2.0",
"jackalope/jackalope-doctrine-dbal": "~1.0.0",
"jackalope/jackalope-jackrabbit": "~1.0.0"
"jackalope/jackalope-doctrine-dbal": "~1.0",
"jackalope/jackalope-jackrabbit": "~1.0"
},
"autoload": {
"psr-0": { "Doctrine\\ODM\\PHPCR": "lib/" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function configure()
->setName('doctrine:phpcr:mapping:info')
->setDescription('Shows basic information about all mapped documents')
->setHelp(<<<EOT
The <info>doctrine:mapping:info</info> shows basic information about which
The <info>doctrine:phpcr:mapping:info</info> shows basic information about which
documents exist and possibly if their mapping information contains errors or
not.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@

use Symfony\Component\Console\Helper\Helper;
use Doctrine\ODM\PHPCR\DocumentManager;
use PHPCR\Util\Console\Helper\PhpcrHelper;
use PHPCR\SessionInterface;

/**
* Helper class to make DocumentManager available to console command
*/
class DocumentManagerHelper extends Helper
class DocumentManagerHelper extends PhpcrHelper
{
protected $session;

/**
* @var DocumentManager
*/
Expand All @@ -46,8 +45,8 @@ public function __construct(SessionInterface $session = null, DocumentManager $d
if (!$session && $dm) {
$session = $dm->getPhpcrSession();
}
parent::__construct($session);

$this->session = $session;
$this->dm = $dm;
}

Expand All @@ -56,11 +55,6 @@ public function getDocumentManager()
return $this->dm;
}

public function getSession()
{
return $this->session;
}

public function getName()
{
return 'phpcr';
Expand Down
2 changes: 1 addition & 1 deletion tests/travis_doctrine_dbal.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

composer require jackalope/jackalope-doctrine-dbal:1.0.0-RC4 --no-update
composer require jackalope/jackalope-doctrine-dbal:~1.0 --no-update
composer update --prefer-source

SCRIPT_NAME="${0##*/}"
Expand Down
2 changes: 1 addition & 1 deletion tests/travis_jackrabbit.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

composer require jackalope/jackalope-jackrabbit:1.0.0-RC3 --no-update
composer require jackalope/jackalope-jackrabbit:~1.0 --no-update
composer update --prefer-source

SCRIPT_NAME="${0##*/}"
Expand Down

0 comments on commit 94f1c5e

Please sign in to comment.