Skip to content

Commit

Permalink
extensions: headers are not send and session is not started in CLI mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 25, 2015
1 parent 4384690 commit 355aa59
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Bridges/HttpDI/HttpExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ public function loadConfiguration()

public function afterCompile(Nette\PhpGenerator\ClassType $class)
{
if (PHP_SAPI === 'cli') {
return;
}

$initialize = $class->getMethod('initialize');
$config = $this->getConfig();

Expand Down
4 changes: 4 additions & 0 deletions src/Bridges/HttpDI/SessionExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ public function loadConfiguration()

public function afterCompile(Nette\PhpGenerator\ClassType $class)
{
if (PHP_SAPI === 'cli') {
return;
}

$initialize = $class->getMethod('initialize');
$config = $this->getConfig();
$name = $this->prefix('session');
Expand Down
2 changes: 1 addition & 1 deletion tests/Http.DI/SessionExtension.autoStart.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Assert::same($session, $container->getService('session'));


$container->initialize();
Assert::true($session->isStarted());
Assert::same(PHP_SAPI !== 'cli', $session->isStarted());

0 comments on commit 355aa59

Please sign in to comment.