Skip to content

Fix include path #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Bridges/HttpKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ class HttpKernel implements BridgeInterface
*/
public function bootstrap($appBootstrap, $appenv)
{
require_once './vendor/autoload.php';
// include applications autoload
$autoloader = dirname(realpath($_SERVER['SCRIPT_NAME'])) . '/vendor/autoload.php';
if (file_exists($autoloader)) {
require_once $autoloader;
}

if (false === class_exists($appBootstrap)) {
$appBootstrap = '\\' . $appBootstrap;
Expand Down Expand Up @@ -91,15 +95,15 @@ public function onRequest(ReactRequest $request, ReactResponse $response)
$response->end();
return;
}

self::mapResponse($response, $syResponse);
}
});
}

/**
* Convert React\Http\Request to Symfony\Component\HttpFoundation\Request
*
*
* @param ReactRequest $reactRequest
* @return SymfonyRequest $syRequest
*/
Expand Down Expand Up @@ -132,7 +136,7 @@ protected static function mapRequest(ReactRequest $reactRequest, $content)

/**
* Convert Symfony\Component\HttpFoundation\Response to React\Http\Response
*
*
* @param ReactResponse $reactResponse
* @param SymfonyResponse $syResponse
*/
Expand Down