mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
wakeless: #2144 - More memory-efficient version of admin/publishall
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@48235 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b00e1ca72e
commit
96fee2a031
@ -1137,14 +1137,23 @@ HTML;
|
|||||||
ini_set('max_execution_time', 300);
|
ini_set('max_execution_time', 300);
|
||||||
|
|
||||||
if(isset($_POST['confirm'])) {
|
if(isset($_POST['confirm'])) {
|
||||||
$pages = DataObject::get("SiteTree");
|
$start = 0;
|
||||||
|
$pages = DataObject::get("SiteTree", "", "", "", "$start,30");
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach($pages as $page) {
|
while(true) {
|
||||||
$this->performPublish($page);
|
foreach($pages as $page) {
|
||||||
$page->destroy();
|
$this->performPublish($page);
|
||||||
unset($page);
|
$page->destroy();
|
||||||
$count++;
|
unset($page);
|
||||||
echo "<li>$count";
|
$count++;
|
||||||
|
echo "<li>$count</li>";
|
||||||
|
}
|
||||||
|
if($pages->Count() > 29) {
|
||||||
|
$start += 30;
|
||||||
|
$pages = DataObject::get("SiteTree", "", "", "", "$start,30");
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), $count);
|
echo sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), $count);
|
||||||
|
Loading…
Reference in New Issue
Block a user