$sfdir = realpath($this->container->getParameter('kernel.root_dir') . '/../');
$apppath = realpath($sfdir . '/' . $app['path']);
$webdir = realpath($sfdir . '/web');
$debug = $this->container->getParameter('kernel.debug');
if($debug) {
$url = 'http://0.0.0.0:' . (array_key_exists('port', $app) ? $app['port'] : '4200');
$content = file_get_contents($url);
$assetprefix = $url;
} else {
$content = file_get_contents($apppath . '/dist/index.html');
$relapppath = preg_replace('%^' . preg_quote($webdir) . '%', '', $apppath);
$assetprefix = $relapppath . '/dist';
}
$assetprefix = rtrim($assetprefix, '/') . '/';
# On récupère la balise meta config/environment
$kept = array();
$kept[] = $this->produceConfigurationMeta($content, $options, function($config) {
$config['locationType'] = 'hash';
return $config;
});
$parts = $this->extractAppAndRewriteAssetsUrl($content, $assetprefix, $kept);
return new PortalApplicationResponse($parts['assets'], $parts['html']);
}