Skip to content

Commit

Permalink
Merge pull request #5 from PhantPHP/Fix-path-not-exists
Browse files Browse the repository at this point in the history
Fix : path not exists
  • Loading branch information
lennyrouanet authored Nov 7, 2023
2 parents 422e6be + e157f8f commit cdc4f1f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions component/AssetsVersions.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ private function getFromPath(string $assetPath): ?AssetVersion
private function getAssetVersionFromGitRevisions(string $assetPath): ?AssetVersion
{
$realPath = realpath($this->pathToBeProcessed . $assetPath);

if (!$realPath) {
return null;
}

$command = sprintf('git log --oneline %s | wc -l', escapeshellarg($realPath));
$revision = (int) exec($command);
Expand All @@ -124,6 +128,11 @@ private function getAssetVersionFromGitRevisions(string $assetPath): ?AssetVersi
private function getAssetVersionFromFileUpdateTime(string $assetPath): ?AssetVersion
{
$realPath = realpath($this->pathToBeProcessed . $assetPath);

if (!$realPath) {
return null;
}

$modificationTime = (int) filemtime($realPath);

if (!$modificationTime) {
Expand Down

0 comments on commit cdc4f1f

Please sign in to comment.