- A lot of fixes done on this for a test project.

This commit is contained in:
mcndave committed 2021-02-16 03:10:04 +00:00
1 parent 52e55f2bba
commit 09b3e47c19
11 files changed
+78 -21

No files matched your search

+9 -5
View File
@@ -29,6 +29,8 @@ return [
'order' => 99,
],
],
'extensions' => [],
],
'ulmus' => [],
@@ -60,7 +62,7 @@ return [
Lean::class => autowire(Lean::class),
CronardMiddleware::class => function($c) {
$cronardMiddleware = new CronardMiddleware(getenv('CRON_KEY'), function() : ResponseInterface {
$cronardMiddleware = new CronardMiddleware($c, getenv('CRON_KEY'), function() : ResponseInterface {
return new TextResponse(sprintf("%s - cron task begin...", date('Y-m-d H:i:s')));
});
@@ -82,11 +84,13 @@ return [
$gitdir = getenv("PROJECT_PATH") . DIRECTORY_SEPARATOR . ".git" . DIRECTORY_SEPARATOR;
if ( false !== ( $currentBranch = file_get_contents( $gitdir . "HEAD") ) ) {
$file = explode(": ", $currentBranch)[1];
$path = $gitdir . str_replace("/", DIRECTORY_SEPARATOR, trim($file, " \t\n\r"));
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 trim(file_get_contents( $path ), " \t\n\r");
return trim(file_get_contents($path), " \t\n\r");
}
}
return "gitless-project";