[icinga-checkins] icinga.org: icinga-web/jmosshammer/default: * Readded agavi binary

git at icinga.org git at icinga.org
Sun Mar 20 11:26:10 CET 2011


Module: icinga-web
Branch: jmosshammer/default
Commit: f251a3eb179dfbe6048357f6828dbcde2cb26b9e
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=f251a3eb179dfbe6048357f6828dbcde2cb26b9e

Author: Marius Hein <marius.hein at netways.de>
Date:   Thu Feb 24 16:23:36 2011 +0100

* Readded agavi binary

---

 lib/agavi/bin/agavi |  102 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 102 insertions(+), 0 deletions(-)

diff --git a/lib/agavi/bin/agavi b/lib/agavi/bin/agavi
new file mode 100755
index 0000000..0e70f69
--- /dev/null
+++ b/lib/agavi/bin/agavi
@@ -0,0 +1,102 @@
+#! /bin/sh
+# This file is part of the Agavi package.
+# Copyright (c) 2005-2010 the Agavi Project.
+#
+# For the full copyright and license information, please view the LICENSE file
+# that was distributed with this source code. You can also view the LICENSE
+# file online at http://www.agavi.org/LICENSE.txt
+
+# Set this to the path to the Agavi installation's source directory. This is
+# the directory that contains the `agavi.php' file.
+AGAVI_SOURCE_DIRECTORY=$(readlink -f $(dirname $(readlink -f $0))/../src)
+
+# Set this to the path to a PHP binary.
+PHP_EXECUTABLE=$( which php )
+
+# Message display shortcuts.
+agavi_message_null()
+{
+	printf "\n"
+}
+
+agavi_message_notice()
+{
+	MESSAGE=$1
+	printf "   [notice] %s\n" "${MESSAGE}"
+}
+
+agavi_message_warning()
+{
+	MESSAGE=$1
+	printf "  [warning] %s\n" "${MESSAGE}"
+}
+
+agavi_message_error()
+{
+	MESSAGE=$1
+	printf "    [error] %s\n" "${MESSAGE}"
+}
+
+agavi_message_fatal()
+{
+	MESSAGE=$1
+	RETURN=$2
+	printf "    [fatal] %s\n" "${MESSAGE}"
+	exit $RETURN
+}
+
+agavi_input()
+{
+	VARIABLE=$1
+	MESSAGE=$2
+	PROMPT=$3
+	printf "        [?] %s%s " "${MESSAGE}" "${PROMPT}"
+	read "${VARIABLE}"
+}
+
+# Initial detection.
+php_executable_exists()
+{
+	if test -x "${PHP_EXECUTABLE}"; then
+		return 0
+	else
+		return 1
+	fi
+}
+
+agavi_directory_exists()
+{
+	if test -d "${AGAVI_SOURCE_DIRECTORY}" -a -e "${AGAVI_SOURCE_DIRECTORY}/agavi.php"; then
+		return 0
+	else
+		return 1
+	fi
+}
+
+until php_executable_exists; do
+	if [ -z "${PHP_EXECUTABLE}" ]; then
+		PHP_EXECUTABLE="(unknown)"
+	fi
+	agavi_message_error "PHP not found at ${PHP_EXECUTABLE}."
+	agavi_message_error "Please set the PHP_EXECUTABLE variable in the script"
+	agavi_message_error "${0} to avoid this message."
+	agavi_message_null
+	agavi_input PHP_EXECUTABLE "Path to PHP executable" ":"
+	agavi_message_null
+done
+
+until agavi_directory_exists; do
+	if [ -z "${AGAVI_SOURCE_DIRECTORY}" ]; then
+		AGAVI_SOURCE_DIRECTORY="(unknown)"
+	fi
+	agavi_message_error "No Agavi installation found in ${AGAVI_SOURCE_DIRECTORY}."
+	agavi_message_error "Please set the AGAVI_SOURCE_DIRECTORY variable in the script"
+	agavi_message_error "${0} to avoid this message."
+	agavi_message_null
+	agavi_input AGAVI_SOURCE_DIRECTORY "Path to Agavi source directory" ":"
+	agavi_message_null
+done
+
+# Call build script.
+`which rlwrap` ${PHP_EXECUTABLE} -d memory_limit=4294967295 -f "${AGAVI_SOURCE_DIRECTORY}/build/agavi/script/agavi.php" -- --agavi-source-directory "${AGAVI_SOURCE_DIRECTORY}" "$@"
+





More information about the icinga-checkins mailing list