From 0054bbc02250d139331db509f769e9d4115658fa Mon Sep 17 00:00:00 2001 From: dantleech Date: Mon, 8 Dec 2014 12:10:04 +0100 Subject: [PATCH 1/5] "Fixed" deprecation warnings --- .../Console/Application/ShellApplication.php | 4 +-- src/PHPCR/Shell/Console/Helper/HelperSet.php | 25 +++++++++++++++++++ .../Shell/Console/Helper/TableHelper.php | 7 +++++- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 src/PHPCR/Shell/Console/Helper/HelperSet.php diff --git a/src/PHPCR/Shell/Console/Application/ShellApplication.php b/src/PHPCR/Shell/Console/Application/ShellApplication.php index bb82d102..65cbd2d4 100644 --- a/src/PHPCR/Shell/Console/Application/ShellApplication.php +++ b/src/PHPCR/Shell/Console/Application/ShellApplication.php @@ -9,6 +9,8 @@ use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\EventDispatcher\EventDispatcher; use PHPCR\Shell\Console\Command\Phpcr as CommandPhpcr; use PHPCR\Shell\Console\Command\Shell as CommandShell; @@ -18,8 +20,6 @@ use PHPCR\Shell\Event\PhpcrShellEvents; use PHPCR\Shell\Console\Command\Phpcr\PhpcrShellCommand; use PHPCR\Shell\Config\Profile; -use Symfony\Component\DependencyInjection\ContainerAwareInterface; -use Symfony\Component\EventDispatcher\EventDispatcher; /** * Main application for PHPCRSH diff --git a/src/PHPCR/Shell/Console/Helper/HelperSet.php b/src/PHPCR/Shell/Console/Helper/HelperSet.php new file mode 100644 index 00000000..4d6a617a --- /dev/null +++ b/src/PHPCR/Shell/Console/Helper/HelperSet.php @@ -0,0 +1,25 @@ + + */ +class HelperSet extends BaseHelperSet +{ + public function get($name) + { + $level = error_reporting(0); + $helper = parent::get($name); + error_reporting($level); + return $helper; + } + +} + diff --git a/src/PHPCR/Shell/Console/Helper/TableHelper.php b/src/PHPCR/Shell/Console/Helper/TableHelper.php index 7f3b2e4f..2ff09039 100644 --- a/src/PHPCR/Shell/Console/Helper/TableHelper.php +++ b/src/PHPCR/Shell/Console/Helper/TableHelper.php @@ -17,9 +17,14 @@ class TableHelper extends OriginalTableHelper { private $numberOfRows = 0; + public function __construct() + { + parent::__construct(false); + } + public function create() { - return new self; + return new self(false); } public function addRow(array $row) From 4fcbd99ec327dbb6c153a7b88e312721436847c6 Mon Sep 17 00:00:00 2001 From: dantleech Date: Thu, 18 Dec 2014 23:20:47 +0100 Subject: [PATCH 2/5] Fixed rebase --- composer.json | 2 +- src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php | 2 +- src/PHPCR/Shell/Phpcr/PhpcrSession.php | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 68e20519..ef4e63e2 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "symfony/serializer": "~2.3", "symfony/yaml": "~2.3", "symfony/dependency-injection": "~2.3", - "dantleech/glob": "~0.1" + "dantleech/glob-finder": "~0.1" }, "minimum-stability": "dev", "require-dev": { diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php index 1522660c..f6537a0b 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php @@ -62,7 +62,7 @@ public function execute(InputInterface $input, OutputInterface $output) $nodes = array($session->getNodeByPathOrIdentifier($path)); $filter = null; } catch (\Exception $e) { - $parentPath = $this->getHelper('path')->getParentPath($path); + $parentPath = $this->get('helper.path')->getParentPath($path); $filter = substr($path, strlen($parentPath)); diff --git a/src/PHPCR/Shell/Phpcr/PhpcrSession.php b/src/PHPCR/Shell/Phpcr/PhpcrSession.php index 1835456a..9175b897 100644 --- a/src/PHPCR/Shell/Phpcr/PhpcrSession.php +++ b/src/PHPCR/Shell/Phpcr/PhpcrSession.php @@ -6,6 +6,7 @@ use PHPCR\CredentialsInterface; use PHPCR\Util\UUIDHelper; use PHPCR\PathNotFoundException; +use DTL\Glob\Finder\PhpcrTraversalFinder; /** * Custom session wrapper for PHPCR Shell @@ -18,10 +19,12 @@ class PhpcrSession implements SessionInterface { protected $session; protected $cwd = '/'; + protected $finder; - public function __construct(SessionInterface $session) + public function __construct(SessionInterface $session, $finder = null) { $this->session = $session; + $this->finder = $finder ? : new PhpcrTraversalFinder($session); } /** From e532a7da99da0e8f85aae5d40e3273ec32c4a496 Mon Sep 17 00:00:00 2001 From: dantleech Date: Thu, 18 Dec 2014 23:22:59 +0100 Subject: [PATCH 3/5] Updated CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0f92eff..2c43a6d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ dev-master ---------- - [transport] Added transport layer for experimental Jackalope FS implementation +- [misc] Wildcard (single asterisk) support in paths - [node] Added wilcard support to applicable node commands, including "node:list", "node:remove" and "node:property:show" - [global] Refactored to use DI container and various general improvements - [node:references] Shows the referencing node paths instead of the referrered-to node path(s) From ae05d1b7c57694db69f952d203ba4e31c5b305ee Mon Sep 17 00:00:00 2001 From: dantleech Date: Fri, 19 Dec 2014 00:23:49 +0100 Subject: [PATCH 4/5] Fixed helpers --- src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php | 4 ++-- .../Shell/Console/Command/Phpcr/NodePropertyShowCommand.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php index 6e6643bc..1858c2cb 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php @@ -27,8 +27,8 @@ public function execute(InputInterface $input, OutputInterface $output) { $session = $this->get('phpcr.session'); $path = $input->getArgument('path'); - $nodeHelper = $this->getHelper('node'); - $formatter = $this->getHelper('result_formatter'); + $nodeHelper = $this->get('helper.node'); + $formatter = $this->get('helper.result_formatter'); $nodes = $session->findNodes($path); diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyShowCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyShowCommand.php index 7e60c4da..6a203381 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyShowCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodePropertyShowCommand.php @@ -28,7 +28,7 @@ public function execute(InputInterface $input, OutputInterface $output) $path = $session->getAbsPath($input->getArgument('path')); $resultFormatHelper = $this->get('helper.result_formatter'); $pathHelper = $this->get('helper.path'); - $resultFormatHelper = $this->getHelper('result_formatter'); + $resultFormatHelper = $this->get('helper.result_formatter'); $parentPath = $pathHelper->getParentPath($path); $filter = $pathHelper->getNodeName($path); From ecd3cf40e068b2a38bef996847ce3b7a2f32b8d5 Mon Sep 17 00:00:00 2001 From: dantleech Date: Fri, 19 Dec 2014 00:35:50 +0100 Subject: [PATCH 5/5] Removed redundant helperset --- src/PHPCR/Shell/Console/Helper/HelperSet.php | 25 -------------------- 1 file changed, 25 deletions(-) delete mode 100644 src/PHPCR/Shell/Console/Helper/HelperSet.php diff --git a/src/PHPCR/Shell/Console/Helper/HelperSet.php b/src/PHPCR/Shell/Console/Helper/HelperSet.php deleted file mode 100644 index 4d6a617a..00000000 --- a/src/PHPCR/Shell/Console/Helper/HelperSet.php +++ /dev/null @@ -1,25 +0,0 @@ - - */ -class HelperSet extends BaseHelperSet -{ - public function get($name) - { - $level = error_reporting(0); - $helper = parent::get($name); - error_reporting($level); - return $helper; - } - -} -