- Added a GIT lib to query directly from it's folder
This commit is contained in:
1 parent
9df5b12aef
commit
63dd672467
2 files changed
+34
-12
No files matched your search
@@ -80,18 +80,7 @@ return [
|
||||
return uniqid("debug_");
|
||||
}
|
||||
|
||||
$gitdir = getenv("PROJECT_PATH") . DIRECTORY_SEPARATOR . ".git" . DIRECTORY_SEPARATOR;
|
||||
|
||||
if ( file_exists($gitdir . "HEAD") ) {
|
||||
if (false !== ($currentBranch = file_get_contents($gitdir . "HEAD"))) {
|
||||
$file = explode(": ", $currentBranch)[1];
|
||||
$path = $gitdir . str_replace("/", DIRECTORY_SEPARATOR, trim($file, " \t\n\r"));
|
||||
|
||||
return file_exists($path) ? trim(file_get_contents($path), " \t\n\r") : null;
|
||||
}
|
||||
}
|
||||
|
||||
return "gitless-project";
|
||||
return \Lean\Git::getLatestCommit(getenv("PROJECT_PATH"));
|
||||
},
|
||||
|
||||
Kash\CacheInvalidator::class => create(Kash\CacheInvalidator::class)->constructor(getenv('CACHE_PATH')."/version.cache", (bool) getenv('DEBUG')),
|
||||
|
||||
Reference in new issue
Block a user