summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-03-14 16:56:33 +1100
committerMichael Save <savetheinternet@tinyboard.org>2012-03-14 16:56:33 +1100
commit272cc7c2f954bddd173cdc0317980c3c0e3133c5 (patch)
treeec402daee9e9624e3666b8ac2165f95838096eb1
parent6720cd095bcaab3c6bdc9e8fd5bc5383d12bd589 (diff)
use "git pull" in auto-upgrade if available
-rw-r--r--mod.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/mod.php b/mod.php
index 5e3846d7..f13af0ef 100644
--- a/mod.php
+++ b/mod.php
@@ -272,6 +272,20 @@
if($mod['type'] != ADMIN)
error($config['error']['noaccess']);
+ if(is_dir('.git')) {
+ // use git instead
+
+ $body = '<div class="ban"><h2>git pull</h2>';
+ $body .= '<p>' . str_replace("\n", '<br/>', shell_exec('git pull')) . '</p>';
+ $body .= '</div>';
+ echo Element('page.html', Array(
+ 'config' => $config,
+ 'title' => 'Upgraded',
+ 'body' => $body
+ ));
+ exit;
+ }
+
if(!extension_loaded('curl'))
error('You need the cURL PHP extension to do that.');