commit 3a8e8256ac1a3fc068e32ef2c1ef6a5335518584
parent eaca1b3b631fe4e25b015dcc0ff494a035fc9e00
Author: Felicitus <felicitus@felicitus.org>
Date: Sun, 25 Dec 2011 06:43:50 +0100
Added PartKeepr version
Diffstat:
4 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/build.xml b/build.xml
@@ -206,13 +206,23 @@
<delete dir="${packagepath}/frontend/resources/fugue-icons/icons-shadowless/"/>
</target>
+ <target name="set-version">
+ <exec executable="sed">
+ <arg value="s/{V_GIT}/${partkeepr.version}/g" />
+ <arg value="${packagepath}/src/backend/de/RaumZeitLabor/PartKeepr/PartKeeprVersion.php" />
+ </exec>
+ </target>
+
<target name="nightly">
<phingcall target="prepare-archiving"/>
<tstamp>
<format property="build.time" pattern="partkeepr-nightly-%Y%m%d"/>
</tstamp>
-
+
+ <property name="partkeepr.version" value="{build.time}-nightly" />
+ <phingcall target="set-version"/>
+
<zip destfile="${build.time}.zip" basedir="${packagepath}" prefix="partkeepr-nightly"/>
<tar destfile="${build.time}.tbz2" compression="bzip2" basedir="${packagepath}" prefix="partkeepr-nightly"/>
</target>
diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/PartKeepr.php b/src/backend/de/RaumZeitLabor/PartKeepr/PartKeepr.php
@@ -303,5 +303,28 @@ class PartKeepr {
mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
);
}
+
+ /**
+ * Returns the current PartKeepr version.
+ * @return string The PartKeepr Version
+ */
+ public static function getVersion () {
+ if (PartKeeprVersion::PARTKEEPR_VERSION == "{V_GIT}") {
+ return "GIT development version";
+ }
+ return self::PARTKEEPR_VERSION;
+ }
}
-?>-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/PartKeeprVersion.php b/src/backend/de/RaumZeitLabor/PartKeepr/PartKeeprVersion.php
@@ -0,0 +1,15 @@
+<?php
+namespace de\RaumZeitLabor\PartKeepr;
+
+class PartKeeprVersion {
+ /**
+ * Holds the PartKeepr Version.
+ *
+ * If {V_GIT}, then the function will return 'GIT Development Version'.
+ * {V_GIT} will be replaced by the build script with the actual version.
+ *
+ * The reason why we have a separate class for the version constant is that
+ * we can easily replace it from scripts.
+ */
+ const PARTKEEPR_VERSION = '{V_GIT}';
+}+
\ No newline at end of file
diff --git a/src/backend/de/RaumZeitLabor/PartKeepr/System/SystemService.php b/src/backend/de/RaumZeitLabor/PartKeepr/System/SystemService.php
@@ -48,6 +48,8 @@ class SystemService extends Service {
$aData[] = new SystemInformationRecord("post_max_size", ini_get("post_max_size"), "PHP");
$aData[] = new SystemInformationRecord("allow_url_fopen", ini_get("allow_url_fopen"), "PHP");
+ $aData[] = new SystemInformationRecord("PartKeepr Version", PartKeepr::getVersion(), "PartKeepr");
+
// TODO: add information about post max, file upload size, timeout, memory limit
return array("data" => $aData);
}