dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b743ecf
)
(bug 29492) Long-running steps in the installer (such as Upgrade and Install) can...
author
Chad Horohoe
<demon@users.mediawiki.org>
Tue, 21 Jun 2011 01:13:45 +0000
(
01:13
+0000)
committer
Chad Horohoe
<demon@users.mediawiki.org>
Tue, 21 Jun 2011 01:13:45 +0000
(
01:13
+0000)
RELEASE-NOTES-1.19
patch
|
blob
|
history
includes/installer/Installer.php
patch
|
blob
|
history
includes/installer/WebInstaller.php
patch
|
blob
|
history
includes/installer/WebInstallerPage.php
patch
|
blob
|
history
diff --git
a/RELEASE-NOTES-1.19
b/RELEASE-NOTES-1.19
index
fb2f0d2
..
180817b
100644
(file)
--- a/
RELEASE-NOTES-1.19
+++ b/
RELEASE-NOTES-1.19
@@
-108,6
+108,8
@@
production.
* (bug 29342) Patrol preferences shouldn't be visible to users who don't have
patrol permissions
* (bug 29471) Exception thrown for files with invalid date in metadata
* (bug 29342) Patrol preferences shouldn't be visible to users who don't have
patrol permissions
* (bug 29471) Exception thrown for files with invalid date in metadata
+* (bug 29492) Long-running steps in the installer (such as Upgrade and Install)
+ can sometimes timeout
=== API changes in 1.19 ===
* BREAKING CHANGE: action=watch now requires POST and token.
=== API changes in 1.19 ===
* BREAKING CHANGE: action=watch now requires POST and token.
diff --git
a/includes/installer/Installer.php
b/includes/installer/Installer.php
index
c496ecc
..
f9f59cd
100644
(file)
--- a/
includes/installer/Installer.php
+++ b/
includes/installer/Installer.php
@@
-1533,4
+1533,14
@@
abstract class Installer {
public function addInstallStep( $callback, $findStep = 'BEGINNING' ) {
$this->extraInstallSteps[$findStep][] = $callback;
}
public function addInstallStep( $callback, $findStep = 'BEGINNING' ) {
$this->extraInstallSteps[$findStep][] = $callback;
}
+
+ /**
+ * Disable the time limit for execution.
+ * Some long-running pages (Install, Upgrade) will want to do this
+ */
+ protected function disableTimeLimit() {
+ wfSuppressWarnings();
+ set_time_limit( 0 );
+ wfRestoreWarnings();
+ }
}
}
diff --git
a/includes/installer/WebInstaller.php
b/includes/installer/WebInstaller.php
index
4ea0cd4
..
4189ece
100644
(file)
--- a/
includes/installer/WebInstaller.php
+++ b/
includes/installer/WebInstaller.php
@@
-247,6
+247,10
@@
class WebInstaller extends Installer {
$this->currentPageName = $page->getName();
$this->startPageWrapper( $pageName );
$this->currentPageName = $page->getName();
$this->startPageWrapper( $pageName );
+ if( $page->isSlow() ) {
+ $this->disableTimeLimit();
+ }
+
$result = $page->execute();
$this->endPageWrapper();
$result = $page->execute();
$this->endPageWrapper();
diff --git
a/includes/installer/WebInstallerPage.php
b/includes/installer/WebInstallerPage.php
index
f0ae6ba
..
a06dc20
100644
(file)
--- a/
includes/installer/WebInstallerPage.php
+++ b/
includes/installer/WebInstallerPage.php
@@
-32,6
+32,15
@@
abstract class WebInstallerPage {
$this->parent = $parent;
}
$this->parent = $parent;
}
+ /**
+ * Is this a slow-running page in the installer? If so, WebInstaller will
+ * set_time_limit(0) before calling execute(). Right now this only applies
+ * to Install and Upgrade pages
+ */
+ public function isSlow() {
+ return false;
+ }
+
public function addHTML( $html ) {
$this->parent->output->addHTML( $html );
}
public function addHTML( $html ) {
$this->parent->output->addHTML( $html );
}
@@
-467,6
+476,9
@@
class WebInstaller_DBConnect extends WebInstallerPage {
}
class WebInstaller_Upgrade extends WebInstallerPage {
}
class WebInstaller_Upgrade extends WebInstallerPage {
+ public function isSlow() {
+ return true;
+ }
public function execute() {
if ( $this->getVar( '_UpgradeDone' ) ) {
public function execute() {
if ( $this->getVar( '_UpgradeDone' ) ) {
@@
-1086,6
+1098,9
@@
class WebInstaller_Options extends WebInstallerPage {
}
class WebInstaller_Install extends WebInstallerPage {
}
class WebInstaller_Install extends WebInstallerPage {
+ public function isSlow() {
+ return true;
+ }
public function execute() {
if( $this->getVar( '_UpgradeDone' ) ) {
public function execute() {
if( $this->getVar( '_UpgradeDone' ) ) {