From 272cc7c2f954bddd173cdc0317980c3c0e3133c5 Mon Sep 17 00:00:00 2001 From: Michael Save Date: Wed, 14 Mar 2012 16:56:33 +1100 Subject: [PATCH] use "git pull" in auto-upgrade if available --- mod.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 = '

git pull

'; + $body .= '

' . str_replace("\n", '
', shell_exec('git pull')) . '

'; + $body .= '
'; + 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.');