Skip to content

Commit 2b1e514

Browse files
committed
Updated
1 parent e19d8ce commit 2b1e514

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ PHPCR > select * from nt:unstructured;
5858

5959
## Changing the CWD
6060

61-
The PHPCR shell (will) allows you to navigate the PHPCR document hierarchy like a file system
61+
The PHPCR shell allows you to navigate the PHPCR document hierarchy like a file system
6262

6363
````bash
6464
PHPCR > ls

src/PHPCR/Shell/Console/Application/ShellApplication.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ public function doRun(InputInterface $input, OutputInterface $output)
100100
$name = $this->getCommandName($input);
101101

102102
if (!$name) {
103-
$name = 'help';
104103
$input = new ArrayInput(array('command' => 'pwd'));
105104
}
106105

src/PHPCR/Shell/PhpcrSession.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ public function getAbsPath($path)
5252
if (substr($path, 0, 1) == '/') {
5353
$absPath = $path;
5454
} else {
55-
$absPath = $this->getCwd() . '/' . $path;
55+
if ($this->cwd == '/') {
56+
$absPath = sprintf('/%s', $path);
57+
} else {
58+
$absPath = sprintf('%s/%s', $this->getCwd(), $path);
59+
}
5660
}
5761

5862
return $absPath;
@@ -161,7 +165,7 @@ public function propertyExists($path)
161165

162166
public function move($srcAbsPath, $destAbsPath)
163167
{
164-
return $this->session->move($srcAbsPath, $destAbsPath);
168+
return $this->session->move($this->getAbsPath($srcAbsPath), $this->getAbsPath($destAbsPath));
165169
}
166170

167171
public function removeItem($path)
@@ -201,7 +205,7 @@ public function hasCapability($methodName, $target, array $arguments)
201205

202206
public function importXML($parentAbsPath, $uri, $uuidBehavior)
203207
{
204-
return $this->session->importXML($parentAbsPath, $uri, $uuidBehavior);
208+
return $this->session->importXML($this->getAbsPath($parentAbsPath), $uri, $uuidBehavior);
205209
}
206210

207211
public function exportSystemView($path, $stream, $skipBinary, $noRecurse)

0 commit comments

Comments
 (0)