X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Finstaller%2FCliInstaller.php;h=567fb10a6913e518f61a349b01d997752f9a6f1c;hb=7e0fb4fff6a247802c2209df48cf9fab8bfb8563;hp=7267ddd2f34a871873c935ea2a91c876922b35f5;hpb=41fa0b12e7c4d38c7e7d20ac099394015ef7a55c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/CliInstaller.php b/includes/installer/CliInstaller.php index 7267ddd2f3..567fb10a69 100644 --- a/includes/installer/CliInstaller.php +++ b/includes/installer/CliInstaller.php @@ -165,6 +165,15 @@ class CliInstaller extends Installer { * Main entry point. */ public function execute() { + // If APC is available, use that as the MainCacheType, instead of nothing. + // This is hacky and should be consolidated with WebInstallerOptions. + // This is here instead of in __construct(), because it should run run after + // doEnvironmentChecks(), which populates '_Caches'. + if ( count( $this->getVar( '_Caches' ) ) ) { + // We detected a CACHE_ACCEL implementation, use it. + $this->setVar( '_MainCacheType', 'accel' ); + } + $vars = Installer::getExistingLocalSettings(); if ( $vars ) { $this->showStatusMessage( @@ -200,24 +209,23 @@ class CliInstaller extends Installer { $this->showMessage( 'config-install-step-done' ); } - public function showMessage( $msg /*, ... */ ) { - echo $this->getMessageText( func_get_args() ) . "\n"; + public function showMessage( $msg, ...$params ) { + echo $this->getMessageText( $msg, $params ) . "\n"; flush(); } - public function showError( $msg /*, ... */ ) { - echo "***{$this->getMessageText( func_get_args() )}***\n"; + public function showError( $msg, ...$params ) { + echo "***{$this->getMessageText( $msg, $params )}***\n"; flush(); } /** + * @param string $msg * @param array $params * * @return string */ - protected function getMessageText( $params ) { - $msg = array_shift( $params ); - + protected function getMessageText( $msg, $params ) { $text = wfMessage( $msg, $params )->parse(); $text = preg_replace( '/(.*?)<\/a>/', '$2 <$1>', $text );