File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -109,25 +109,28 @@ private function getFromPath(string $assetPath): ?AssetVersion
109
109
110
110
private function getAssetVersionFromGitRevisions (string $ assetPath ): ?AssetVersion
111
111
{
112
- $ command = sprintf ('git log --oneline %s | wc -l ' , escapeshellarg ($ this ->pathToBeProcessed . $ assetPath ));
113
- $ revision = exec ($ command );
112
+ $ realPath = realpath ($ this ->pathToBeProcessed . $ assetPath );
113
+
114
+ $ command = sprintf ('git log --oneline %s | wc -l ' , escapeshellarg ($ realPath ));
115
+ $ revision = (int ) exec ($ command );
114
116
115
117
if (!$ revision ) {
116
118
return null ;
117
119
}
118
120
119
- return new AssetVersion ($ assetPath , AssetVersion::TYPE_VERSION , ( int ) $ revision );
121
+ return new AssetVersion ($ assetPath , AssetVersion::TYPE_VERSION , $ revision );
120
122
}
121
123
122
124
private function getAssetVersionFromFileUpdateTime (string $ assetPath ): ?AssetVersion
123
125
{
124
- $ modificationTime = filemtime ($ this ->pathToBeProcessed . $ assetPath );
126
+ $ realPath = realpath ($ this ->pathToBeProcessed . $ assetPath );
127
+ $ modificationTime = (int ) filemtime ($ realPath );
125
128
126
129
if (!$ modificationTime ) {
127
130
return null ;
128
131
}
129
132
130
- return new AssetVersion ($ assetPath , AssetVersion::TYPE_MODIFICATION_TIME , ( int ) $ modificationTime );
133
+ return new AssetVersion ($ assetPath , AssetVersion::TYPE_MODIFICATION_TIME , $ modificationTime );
131
134
}
132
135
133
136
private function getAssetPathList (string $ subpath = '' ): array
You can’t perform that action at this time.
0 commit comments