This commit is contained in:
ArthurHoaro 2014-01-04 11:44:50 +01:00
parent 8f3f91ea62
commit fbb381ff5b
2 changed files with 37 additions and 25 deletions

1
.gitignore vendored
View file

@ -11,3 +11,4 @@ autoblogs/*
docs/*
!docs/docs.txt
robots.txt
.idea

View file

@ -376,9 +376,10 @@ if (isset($_GET['sitemap']))
* Update ALL autblogs (except .disabled)
* This action can be very slow and consume CPU if you have a lot of autoblogs
**/
if( isset($_GET['updateall']) && ALLOW_FULL_UPDATE) {
if( isset($_GET['updateall']) ) {
if( !isset( $_GET['force']) ) {
$max_exec_time=time()+4; // scipt have 4 seconds to update autoblogs
$expire = time() - 84600 ; // 23h30 en secondes
$expire = time() - 5 ; // 5 seconds
$lockfile = ".updatealllock";
$lockfile_contents = array();
if (file_exists($lockfile)){
@ -405,7 +406,17 @@ if( isset($_GET['updateall']) && ALLOW_FULL_UPDATE) {
}else{
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
}
}
elseif (ALLOW_FULL_UPDATE) {
$subdirs = glob(AUTOBLOGS_FOLDER . "*");
$max_exec_time=time() * 2; // workaround to disable max exec time
}
else {
echo "You're not allowed to force full update.";
die;
}
$todo_subdirs = $subdirs;
foreach($subdirs as $key => $unit) {
if(is_dir($unit)) {
if( !file_exists(ROOT_DIR . '/' . $unit . '/.disabled')) {