/**
* Base code for web installer pages.
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
* @file
* @ingroup Deployment
*/
* 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
+ * @return bool
*/
public function isSlow() {
return false;
$userLang = $r->getVal( 'uselang' );
$contLang = $r->getVal( 'ContLang' );
- $languages = Language::getLanguageNames();
+ $languages = Language::fetchLanguageNames();
$lifetime = intval( ini_get( 'session.gc_maxlifetime' ) );
if ( !$lifetime ) {
$lifetime = 1440; // PHP default
$s .= Html::openElement( 'select', array( 'id' => $name, 'name' => $name,
'tabindex' => $this->parent->nextTabIndex() ) ) . "\n";
- $languages = Language::getLanguageNames();
+ $languages = Language::fetchLanguageNames();
ksort( $languages );
foreach ( $languages as $code => $lang ) {
if ( isset( $wgDummyLanguageCodes[$code] ) ) continue;
/**
* Initiate an upgrade of the existing database
- * @param $vars Variables from LocalSettings.php and AdminSettings.php
+ * @param $vars array Variables from LocalSettings.php and AdminSettings.php
* @return Status
*/
protected function handleExistingUpgrade( $vars ) {
}
public function getFileContents() {
- return file_get_contents( dirname( __FILE__ ) . '/../../' . $this->getFileName() );
+ $file = dirname( __FILE__ ) . '/../../' . $this->getFileName();
+ if( ! file_exists( $file ) ) {
+ return wfMsgNoTrans( 'config-nofile', $file );
+ }
+ return file_get_contents( $file );
}
}
}
class WebInstaller_ReleaseNotes extends WebInstaller_Document {
- protected function getFileName() { return 'RELEASE-NOTES'; }
+ protected function getFileName() {
+ global $wgVersion;
+
+ if(! preg_match( '/^(\d+)\.(\d+).*/i', $wgVersion, $result ) ) {
+ throw new MWException('Variable $wgVersion has an invalid value.');
+ }
+
+ return 'RELEASE-NOTES-' . $result[1] . '.' . $result[2];
+ }
}
class WebInstaller_UpgradeDoc extends WebInstaller_Document {