Skip to content

Commit d3d7fe9

Browse files
committed
Fixed little notice
1 parent 9dd19ac commit d3d7fe9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/phpFastCache/Api.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,17 @@ public static function getPhpFastCacheVersion($fallbackOnChangelog = true, $cach
9797
}
9898

9999
/**
100+
* @param bool $cacheable
100101
* @return string
101-
* @throws \phpFastCache\Exceptions\phpFastCacheLogicException
102102
*/
103-
public function getPhpFastCacheGitHeadHash()
103+
public static function getPhpFastCacheGitHeadHash($cacheable = true)
104104
{
105+
static $hash;
106+
107+
if($hash && $cacheable){
108+
return $hash;
109+
}
110+
105111
if(function_exists('shell_exec')){
106112
$stdout = shell_exec('git rev-parse --short HEAD');
107113
if(is_string($stdout)){

0 commit comments

Comments
 (0)