mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
use "git pull" in auto-upgrade if available
This commit is contained in:
parent
6720cd095b
commit
272cc7c2f9
14
mod.php
14
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.');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user