Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@googlemail.com>2014-06-03 02:49:34 +0400
committerThomas Steur <thomas.steur@googlemail.com>2014-06-03 02:49:34 +0400
commit1191256f25abfaf92b746151239c79ee84acb151 (patch)
tree4d74c5f13227a434b90a79d1695884ebcc8c2b15 /core/Console.php
parentaebddae1125f8f3dfa59154634199578144cbfeb (diff)
refs #5007 display an error message in case console is executed as type CGI
Diffstat (limited to 'core/Console.php')
-rw-r--r--core/Console.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/core/Console.php b/core/Console.php
index 6f32eb8f33..7cf657e683 100644
--- a/core/Console.php
+++ b/core/Console.php
@@ -13,6 +13,7 @@ use Symfony\Component\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Output\OutputInterface;
class Console extends Application
@@ -30,12 +31,9 @@ class Console extends Application
$this->getDefinition()->addOption($option);
}
- /**
- * @deprecated
- */
public function init()
{
- // TODO: remove
+ $this->checkCompatibility();
}
public function doRun(InputInterface $input, OutputInterface $output)
@@ -128,6 +126,15 @@ class Console extends Application
return $commands;
}
+ private function checkCompatibility()
+ {
+ if (Common::isPhpCgiType()) {
+ echo 'Piwik Console is known to be not compatible with PHP-CGI. Please execute console using PHP-CLI. For instance "/usr/bin/php-cli console ..."';
+ echo "\n";
+ exit(1);
+ }
+ }
+
protected function initPiwikHost(InputInterface $input)
{
$piwikHostname = $input->getParameterOption('--piwik-domain');