We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6e448f commit 160968cCopy full SHA for 160968c
lib/Phpfastcache/Api.php
@@ -69,12 +69,15 @@ public static function getPhpFastCacheVersion($fallbackOnChangelog = true, $cach
69
}
70
71
if(\function_exists('shell_exec')){
72
- $stdout = shell_exec('git describe --abbrev=0 --tags');
+ $command = 'git -C "' . __DIR__ . '" describe --abbrev=0 --tags';
73
+ $stdout = shell_exec($command);
74
if(\is_string($stdout)){
75
$version = \trim($stdout);
76
return $version;
77
- throw new PhpfastcacheLogicException('The git command used to retrieve the PhpFastCache version has failed.');
78
+ if(!$fallbackOnChangelog){
79
+ throw new PhpfastcacheLogicException('The git command used to retrieve the PhpFastCache version has failed.');
80
+ }
81
82
83
if(!$fallbackOnChangelog){
0 commit comments