Skip to content

Commit

Permalink
Fix TokenFile not Found Error on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
theseer committed Feb 2, 2019
1 parent 2902743 commit 0d6445b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/collector/project/Dependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Dependency {

public function __construct(fDOMDocument $dom, Project $project, $publicOnlyMode) {
$this->index = $dom;
$this->baseDir = \dirname(\urldecode($dom->documentURI));
$this->baseDir = \dirname(\str_replace('file:/', '', \urldecode($dom->documentURI)));
$this->index->registerNamespace('phpdox', 'http://xml.phpdox.net/src');
$this->project = $project;
$this->publicOnlyMode = $publicOnlyMode;
Expand Down
2 changes: 1 addition & 1 deletion src/generator/project/TokenFileIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(\DOMNodeList $nodeList) {

public function current(): TokenFile {
$item = $this->nodeList->item($this->pos);
$path = \dirname(\urldecode($item->ownerDocument->documentURI)) . '/' . $item->getAttribute('xml');
$path = \dirname(\str_replace('file:/', '', \urldecode($item->ownerDocument->documentURI))) . '/' . $item->getAttribute('xml');

return new TokenFile(new FileInfo($path));
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function asFileUri(): string {
$result = '/' . $result;
}

return 'file://' . $result;
return 'file://' . urlencode($result);
}

public function getPath() {
Expand Down

0 comments on commit 0d6445b

Please sign in to comment.