Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -108,6 +108,8 @@ |
109 | 109 | * (bug 29342) Patrol preferences shouldn't be visible to users who don't have |
110 | 110 | patrol permissions |
111 | 111 | * (bug 29471) Exception thrown for files with invalid date in metadata |
| 112 | +* (bug 29492) Long-running steps in the installer (such as Upgrade and Install) |
| 113 | + can sometimes timeout |
112 | 114 | |
113 | 115 | === API changes in 1.19 === |
114 | 116 | * BREAKING CHANGE: action=watch now requires POST and token. |
Index: trunk/phase3/includes/installer/WebInstaller.php |
— | — | @@ -247,6 +247,10 @@ |
248 | 248 | $this->currentPageName = $page->getName(); |
249 | 249 | $this->startPageWrapper( $pageName ); |
250 | 250 | |
| 251 | + if( $page->isSlow() ) { |
| 252 | + $this->disableTimeLimit(); |
| 253 | + } |
| 254 | + |
251 | 255 | $result = $page->execute(); |
252 | 256 | |
253 | 257 | $this->endPageWrapper(); |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -1533,4 +1533,14 @@ |
1534 | 1534 | public function addInstallStep( $callback, $findStep = 'BEGINNING' ) { |
1535 | 1535 | $this->extraInstallSteps[$findStep][] = $callback; |
1536 | 1536 | } |
| 1537 | + |
| 1538 | + /** |
| 1539 | + * Disable the time limit for execution. |
| 1540 | + * Some long-running pages (Install, Upgrade) will want to do this |
| 1541 | + */ |
| 1542 | + protected function disableTimeLimit() { |
| 1543 | + wfSuppressWarnings(); |
| 1544 | + set_time_limit( 0 ); |
| 1545 | + wfRestoreWarnings(); |
| 1546 | + } |
1537 | 1547 | } |
Index: trunk/phase3/includes/installer/WebInstallerPage.php |
— | — | @@ -32,6 +32,15 @@ |
33 | 33 | $this->parent = $parent; |
34 | 34 | } |
35 | 35 | |
| 36 | + /** |
| 37 | + * Is this a slow-running page in the installer? If so, WebInstaller will |
| 38 | + * set_time_limit(0) before calling execute(). Right now this only applies |
| 39 | + * to Install and Upgrade pages |
| 40 | + */ |
| 41 | + public function isSlow() { |
| 42 | + return false; |
| 43 | + } |
| 44 | + |
36 | 45 | public function addHTML( $html ) { |
37 | 46 | $this->parent->output->addHTML( $html ); |
38 | 47 | } |
— | — | @@ -467,6 +476,9 @@ |
468 | 477 | } |
469 | 478 | |
470 | 479 | class WebInstaller_Upgrade extends WebInstallerPage { |
| 480 | + public function isSlow() { |
| 481 | + return true; |
| 482 | + } |
471 | 483 | |
472 | 484 | public function execute() { |
473 | 485 | if ( $this->getVar( '_UpgradeDone' ) ) { |
— | — | @@ -1086,6 +1098,9 @@ |
1087 | 1099 | } |
1088 | 1100 | |
1089 | 1101 | class WebInstaller_Install extends WebInstallerPage { |
| 1102 | + public function isSlow() { |
| 1103 | + return true; |
| 1104 | + } |
1090 | 1105 | |
1091 | 1106 | public function execute() { |
1092 | 1107 | if( $this->getVar( '_UpgradeDone' ) ) { |