From 66225fedd25567a2fe06da392b29171774842264 Mon Sep 17 00:00:00 2001 From: Minteck Date: Fri, 6 May 2022 21:56:31 +0200 Subject: Add details to build --- includes/functions.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'includes/functions.php') diff --git a/includes/functions.php b/includes/functions.php index 258ea97..80d663f 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -24,6 +24,30 @@ function build(): string { return "$a.$b"; } +function build_dom(): string { + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/.build")) { + $a = trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/.build")); + } else { + $a = "dev"; + } + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/.prjbuild")) { + $b = trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/.prjbuild")); + } else { + $b = "testing"; + } + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/.build.id")) { + $aa = trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/.build.id")); + } else { + $aa = "-1"; + } + if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/.prjbuild.id")) { + $ba = trim(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/.prjbuild.id")); + } else { + $ba = "-1"; + } + return "$a.$b"; +} + function getLetters(string $project): string { $words = explode(" ", preg_replace('/#+/m', "#", preg_replace('/[^a-z0-9 ]/m', "#", strtolower(trim(preg_replace('/[A-Z]/m', ' $0', $project)))))); -- cgit