1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-31 10:01:56 +02:00

Added cron/function for updating from github. (Available only if the e107 installation is a cloned repo)

This commit is contained in:
Cameron
2014-05-23 21:59:01 -07:00
parent c0675ab6db
commit f428cc8041
4 changed files with 59 additions and 9 deletions

View File

@@ -30,6 +30,37 @@ class _system_cron
// Whatever code you wish.
}
/**
* Update the current Repo. of this e107 installation. (eg. e107 on github)
*/
function gitrepo()
{
$mes = e107::getMessage();
if(is_dir(e_BASE.".git")) // Check it's a Git Repo
{
// Change Dir.
$cmd = 'cd '.e_ROOT;
$mes->addDebug($cmd);
$text .= `$cmd 2>&1`;
// Run Pull request
$cmd = 'git pull';
$mes->addDebug($cmd);
$text .= `$cmd 2>&1`;
$return = print_a($text,true);
$mes->addSuccess($return);
}
else
{
$mes->addError("No git repo found"); //TODO LAN
}
}
/**
* Burnsy - This is just a test
*