Skip to content

Commit cdc4f1f

Browse files
authored
Merge pull request #5 from PhantPHP/Fix-path-not-exists
Fix : path not exists
2 parents 422e6be + e157f8f commit cdc4f1f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

component/AssetsVersions.php

+9
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ private function getFromPath(string $assetPath): ?AssetVersion
110110
private function getAssetVersionFromGitRevisions(string $assetPath): ?AssetVersion
111111
{
112112
$realPath = realpath($this->pathToBeProcessed . $assetPath);
113+
114+
if (!$realPath) {
115+
return null;
116+
}
113117

114118
$command = sprintf('git log --oneline %s | wc -l', escapeshellarg($realPath));
115119
$revision = (int) exec($command);
@@ -124,6 +128,11 @@ private function getAssetVersionFromGitRevisions(string $assetPath): ?AssetVersi
124128
private function getAssetVersionFromFileUpdateTime(string $assetPath): ?AssetVersion
125129
{
126130
$realPath = realpath($this->pathToBeProcessed . $assetPath);
131+
132+
if (!$realPath) {
133+
return null;
134+
}
135+
127136
$modificationTime = (int) filemtime($realPath);
128137

129138
if (!$modificationTime) {

0 commit comments

Comments
 (0)