Skip to content

Commit

Permalink
refs #4121 make sure to execute a command only if in cli mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tsteur committed Oct 4, 2013
1 parent 77867de commit 0ceb094
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/Console/Command.php
Expand Up @@ -10,8 +10,17 @@
*/
namespace Piwik\Console;

use Piwik\Common;
use Symfony\Component\Console\Command\Command as SymfonyCommand;

class Command extends SymfonyCommand
{
public function __construct($name = null)
{
if (!Common::isPhpCliMode()) {
throw new \RuntimeException('Only executable in CLI mode');
}

parent::__construct($name);
}
}

0 comments on commit 0ceb094

Please sign in to comment.