summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--buildscripts/setup.php39
2 files changed, 40 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
index 1de938ec..7c8e4f74 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -17,6 +17,7 @@ buildscripts/phing/tasks/PhpLintTask.php -text
buildscripts/phing/tasks/XmlLintTask.php -text
buildscripts/phpbuilder/build.php -text
buildscripts/phpbuilder/files.txt -text
+buildscripts/setup.php -text
buildscripts/texbuilder/build.php -text
buildscripts/texbuilder/prado3_quick_start.pdf -text
buildscripts/texbuilder/prado3_quick_start.tex -text
diff --git a/buildscripts/setup.php b/buildscripts/setup.php
new file mode 100644
index 00000000..59d636b8
--- /dev/null
+++ b/buildscripts/setup.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Setup script for build system. You could run this script to install or upgrade Phing
+ * with dependencies. Please make sure to change the PEAR_CMD constant to how you want
+ * to execute the PEAR installer.
+ *
+ * @author Knut Urdalen
+ */
+
+// Where to find the PEAR installer
+define('PEAR_CMD', 'sudo pear');
+
+// Storing your preferred_state
+$preferred_state = exec(PEAR_CMD.' config-get preferred_state');
+
+// Setting preferred state temporary to development to automatically get all dependencies
+system(PEAR_CMD.' config-set preferred_state devel');
+
+// Ensure that the PEAR channel protocol is updated
+system(PEAR_CMD.' channel-update pear.php.net');
+
+// Ensure that the Phing PEAR channel is added
+system(PEAR_CMD.' channel-discover pear.phing.info');
+
+// and channel protocol is updated
+system(PEAR_CMD.' channel-update pear.phing.info');
+
+// Checking if Phing is already installed
+$result = exec(PEAR_CMD.' info phing/phing');
+if(strstr($result, 'No information found for')) { // Install
+ system(PEAR_CMD.' install --alldeps phing/phing');
+} else { // Try to upgrade
+ system(PEAR_CMD.' upgrade --alldeps phing/phing');
+}
+
+// Setting your preferred state back to what it was
+system(PEAR_CMD.' config-set preferred_state '.$preferred_state);
+
+?> \ No newline at end of file