Skip to content

Commit 0d6445b

Browse files
committed
Fix TokenFile not Found Error on Windows
Closes #271
1 parent 2902743 commit 0d6445b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/collector/project/Dependency.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Dependency {
2626

2727
public function __construct(fDOMDocument $dom, Project $project, $publicOnlyMode) {
2828
$this->index = $dom;
29-
$this->baseDir = \dirname(\urldecode($dom->documentURI));
29+
$this->baseDir = \dirname(\str_replace('file:/', '', \urldecode($dom->documentURI)));
3030
$this->index->registerNamespace('phpdox', 'http://xml.phpdox.net/src');
3131
$this->project = $project;
3232
$this->publicOnlyMode = $publicOnlyMode;

src/generator/project/TokenFileIterator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(\DOMNodeList $nodeList) {
2020

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

2525
return new TokenFile(new FileInfo($path));
2626
}

src/shared/FileInfo.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function asFileUri(): string {
3535
$result = '/' . $result;
3636
}
3737

38-
return 'file://' . $result;
38+
return 'file://' . urlencode($result);
3939
}
4040

4141
public function getPath() {

0 commit comments

Comments
 (0)