Example #1
0
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details: http://www.gnu.org/licenses/
 *
 * The following people participated in this project:
 *
 * Andreas von Burg.....: Architect, Lead Developer
 * Bert Hofmänner.......: Idea, Community Leader, Marketing
 * Thomas Günther.......: Developer, Hangar
 */
use n2n\web\http\Response;
use n2n\impl\web\ui\view\html\HtmlView;
$view = HtmlView::view($this);
$html = HtmlView::html($this);
$response = HtmlView::response($this);
$httpStatus = $response->getStatus();
$title = $httpStatus . ' ' . Response::textOfStatusCode($httpStatus);
$html->meta()->addCss('css/errorpage-500-development.css');
$html->meta()->addCss('css/font-awesome.css');
?>
<!DOCTYPE html>
<html>
	<?php 
$html->headStart();
?>
		<title><?php 
$html->out($title);
?>
</title>	
	<?php 
$html->headEnd();
?>
Example #2
0
File: N2N.php Project: n2n/n2n
 private function buildHttpContext()
 {
     if (!isset($_SERVER['REQUEST_URI'])) {
         return null;
     }
     $generalConfig = $this->appConfig->general();
     $webConfig = $this->appConfig->web();
     $filesConfig = $this->appConfig->files();
     $request = new VarsRequest($_SERVER, $_GET, $_POST, $_FILES);
     $session = new Session($generalConfig->getApplicationName());
     $response = new Response($request);
     $response->setResponseCachingEnabled($webConfig->isResponseCachingEnabled());
     $response->setResponseCacheStore($this->n2nContext->lookup(ResponseCacheStore::class));
     $response->setHttpCachingEnabled($webConfig->isResponseBrowserCachingEnabled());
     $response->setSendEtagAllowed($webConfig->isResponseSendEtagAllowed());
     $response->setSendLastModifiedAllowed($webConfig->isResponseSendLastModifiedAllowed());
     $assetsUrl = $filesConfig->getAssetsUrl();
     if ($assetsUrl->isRelative() && !$assetsUrl->getPath()->hasLeadingDelimiter()) {
         $assetsUrl = $request->getContextPath()->toUrl()->ext($assetsUrl);
     }
     $localeFormat = new N2nLocaleFormat($webConfig->getAliasN2nLocales());
     $httpContext = new HttpContext($request, $response, $session, $assetsUrl, $localeFormat, $webConfig->getSupersystem(), $webConfig->getSubsystems(), $this->n2nContext);
     $subsystem = $this->detectSubsystem($request->getHostName(), $request->getContextPath());
     $request->setSubsystem($subsystem);
     $n2nLocales = $webConfig->getSupersystem()->getN2nLocales();
     if ($subsystem !== null) {
         $n2nLocales = array_merge($n2nLocales, $subsystem->getN2nLocales());
     }
     $request->setN2nLocale($this->detectN2nLocale($n2nLocales));
     return $httpContext;
 }