parent
c0e4760b38
commit
4f4c679eef
@ -84,6 +84,11 @@ class Client extends BaseClient
|
||||
/**
|
||||
* Returns the script to execute when the request must be insulated.
|
||||
*
|
||||
* It assumes that the autoloader is named 'autoload.php' and that it is
|
||||
* stored in the same directory as the kernel (this is the case for the
|
||||
* Symfony Standard Edition). If this is not your case, create your own
|
||||
* client and override this method.
|
||||
*
|
||||
* @param Request $request A Request instance
|
||||
*
|
||||
* @return string The script content
|
||||
@ -94,11 +99,22 @@ class Client extends BaseClient
|
||||
$request = str_replace("'", "\\'", serialize($request));
|
||||
|
||||
$r = new \ReflectionObject($this->kernel);
|
||||
|
||||
$autoloader = dirname($r->getFileName()).'/autoload.php';
|
||||
if (is_file($autoloader)) {
|
||||
$autoloader = str_replace("'", "\\'", $autoloader);
|
||||
} else {
|
||||
$autoloader = '';
|
||||
}
|
||||
|
||||
$path = str_replace("'", "\\'", $r->getFileName());
|
||||
|
||||
return <<<EOF
|
||||
<?php
|
||||
|
||||
if ('$autoloader') {
|
||||
require_once '$autoloader';
|
||||
}
|
||||
require_once '$path';
|
||||
|
||||
\$kernel = unserialize('$kernel');
|
||||
|
Reference in New Issue
Block a user