Skip to content

Commit 4e72d8b

Browse files
committed
Quick fix for SHTB (self-hosting test bundle) server run regression
1 parent f32ac63 commit 4e72d8b

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

bin/console

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/usr/bin/env php
22
<?php
33

4-
$rootDir = realpath(__DIR__.'/../../../..');
5-
$vendorDir = realpath($rootDir.'/vendor');
6-
require_once $vendorDir.'/symfony-cmf/testing/bootstrap/bootstrap.php';
4+
require_once __DIR__.'/../bootstrap/bootstrap.php';
75

86
use Symfony\Bundle\FrameworkBundle\Console\Application;
97
use Symfony\Component\Console\Input\ArgvInput;

bin/server

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
#!/usr/bin/env php
22
<?php
33

4-
$kernel = include __DIR__.'/../bootstrap/kernel_bootstrap.php';
4+
require_once __DIR__.'/../bootstrap/bootstrap.php';
55

66
use Symfony\Bundle\FrameworkBundle\Console\Application;
77
use Symfony\Component\Console\Input\ArrayInput;
8+
use Symfony\Component\Console\Input\ArgvInput;
9+
10+
// fixme: hack
11+
$input = new ArgvInput();
12+
$env = $input->getParameterOption(array('--env', '-e'), 'phpcr');
813

914
$input = new ArrayInput(array(
1015
'server:run',
1116
'--router' => CMF_TEST_ROOT_DIR.'/resources/web/router.php',
1217
'--docroot' => CMF_TEST_ROOT_DIR.'/resources/web',
1318
));
1419

20+
$kernel = include __DIR__.'/../bootstrap/kernel_bootstrap.php';
21+
1522
$application = new Application($kernel);
1623
$application->run($input);

bootstrap/kernel_bootstrap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
$rootDir = realpath(__DIR__.'/../../../..');
34
$phpUnitFile = $rootDir.'/phpunit.xml.dist';
45

56
if (!file_exists($phpUnitFile)) {

resources/web/app_test.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
ini_set('display_errors', 'On');
66
error_reporting(E_ALL);
77

8+
require_once __DIR__.'/../../bootstrap/bootstrap.php';
9+
10+
// fixme: hack!!
11+
$env = 'phpcr';
12+
813
$kernel = include __DIR__.'/../../bootstrap/kernel_bootstrap.php';
914
$kernel->loadClassCache();
1015
$request = Request::createFromGlobals();

0 commit comments

Comments
 (0)