소스 검색

initial commit

Andi Dittrich 10 년 전
커밋
1ba457b390
17개의 변경된 파일702개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      .buildpath
  2. 4 0
      .gitignore
  3. 50 0
      Build/HTTP400.html
  4. 50 0
      Build/HTTP401.html
  5. 50 0
      Build/HTTP403.html
  6. 50 0
      Build/HTTP404.html
  7. 51 0
      Build/HTTP500.html
  8. 50 0
      Build/HTTP501.html
  9. 51 0
      Build/HTTP502.html
  10. 51 0
      Build/HTTP503.html
  11. 50 0
      Build/HTTP520.html
  12. 51 0
      Build/HTTP521.html
  13. 24 0
      LICENSE.md
  14. 31 0
      README.md
  15. 24 0
      generator.php
  16. 60 0
      pages.php
  17. 50 0
      template.html

+ 5 - 0
.buildpath

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<buildpath>
+	<buildpathentry kind="src" path=""/>
+	<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
+</buildpath>

+ 4 - 0
.gitignore

@@ -0,0 +1,4 @@
+.settings*
+.project
+gfx/*
+PublicHtml/*

+ 50 - 0
Build/HTTP400.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	
+	<title>We've got some trouble | 400 - Bad Request</title>
+	
+	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
+	
+	<style type="text/css">
+		html,body {
+			width: 100%;
+			height: 100%;
+			background-color: #21232a;
+		}
+		
+		body {
+			color: #fff;
+			text-align: center;
+			text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
+			padding: 0px;
+			min-height: 100%;
+			-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			display: table;
+		}
+
+		.lead {
+			color: #c0c0c0;
+		}
+		.cover {
+			display: table-cell;
+			vertical-align: middle;
+			padding: 0 20px;
+		}
+	</style>
+</head>
+
+<body>
+
+
+	<div class="cover">
+		<h1>Bad Request <small>Error 400</small></h1>
+		<p class="lead">The server cannot process the request due to something that is perceived to be a client error.</p>
+	</div>
+	
+</body>
+</html>

+ 50 - 0
Build/HTTP401.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	
+	<title>We've got some trouble | 401 - Unauthorized</title>
+	
+	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
+	
+	<style type="text/css">
+		html,body {
+			width: 100%;
+			height: 100%;
+			background-color: #21232a;
+		}
+		
+		body {
+			color: #fff;
+			text-align: center;
+			text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
+			padding: 0px;
+			min-height: 100%;
+			-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			display: table;
+		}
+
+		.lead {
+			color: #c0c0c0;
+		}
+		.cover {
+			display: table-cell;
+			vertical-align: middle;
+			padding: 0 20px;
+		}
+	</style>
+</head>
+
+<body>
+
+
+	<div class="cover">
+		<h1>Unauthorized <small>Error 401</small></h1>
+		<p class="lead">The requested resource requires an authentication.</p>
+	</div>
+	
+</body>
+</html>

+ 50 - 0
Build/HTTP403.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	
+	<title>We've got some trouble | 403 - Access Denied</title>
+	
+	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
+	
+	<style type="text/css">
+		html,body {
+			width: 100%;
+			height: 100%;
+			background-color: #21232a;
+		}
+		
+		body {
+			color: #fff;
+			text-align: center;
+			text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
+			padding: 0px;
+			min-height: 100%;
+			-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			display: table;
+		}
+
+		.lead {
+			color: #c0c0c0;
+		}
+		.cover {
+			display: table-cell;
+			vertical-align: middle;
+			padding: 0 20px;
+		}
+	</style>
+</head>
+
+<body>
+
+
+	<div class="cover">
+		<h1>Access Denied <small>Error 403</small></h1>
+		<p class="lead">The requested resource requires an authentication.</p>
+	</div>
+	
+</body>
+</html>

+ 50 - 0
Build/HTTP404.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	
+	<title>We've got some trouble | 404 - Resource not found</title>
+	
+	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
+	
+	<style type="text/css">
+		html,body {
+			width: 100%;
+			height: 100%;
+			background-color: #21232a;
+		}
+		
+		body {
+			color: #fff;
+			text-align: center;
+			text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
+			padding: 0px;
+			min-height: 100%;
+			-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			display: table;
+		}
+
+		.lead {
+			color: #c0c0c0;
+		}
+		.cover {
+			display: table-cell;
+			vertical-align: middle;
+			padding: 0 20px;
+		}
+	</style>
+</head>
+
+<body>
+
+
+	<div class="cover">
+		<h1>Resource not found <small>Error 404</small></h1>
+		<p class="lead">The requested resource could not be found but may be available again in the future.</p>
+	</div>
+	
+</body>
+</html>

+ 51 - 0
Build/HTTP500.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	
+	<title>We've got some trouble | 500 - Webservice currently unavailable</title>
+	
+	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
+	
+	<style type="text/css">
+		html,body {
+			width: 100%;
+			height: 100%;
+			background-color: #21232a;
+		}
+		
+		body {
+			color: #fff;
+			text-align: center;
+			text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
+			padding: 0px;
+			min-height: 100%;
+			-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			display: table;
+		}
+
+		.lead {
+			color: #c0c0c0;
+		}
+		.cover {
+			display: table-cell;
+			vertical-align: middle;
+			padding: 0 20px;
+		}
+	</style>
+</head>
+
+<body>
+
+
+	<div class="cover">
+		<h1>Webservice currently unavailable <small>Error 500</small></h1>
+		<p class="lead">An unexpected condition was encountered.<br />
+Our service team has been dispatched to bring it back online.</p>
+	</div>
+	
+</body>
+</html>

+ 50 - 0
Build/HTTP501.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	
+	<title>We've got some trouble | 501 - Not Implemented</title>
+	
+	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
+	
+	<style type="text/css">
+		html,body {
+			width: 100%;
+			height: 100%;
+			background-color: #21232a;
+		}
+		
+		body {
+			color: #fff;
+			text-align: center;
+			text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
+			padding: 0px;
+			min-height: 100%;
+			-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			display: table;
+		}
+
+		.lead {
+			color: #c0c0c0;
+		}
+		.cover {
+			display: table-cell;
+			vertical-align: middle;
+			padding: 0 20px;
+		}
+	</style>
+</head>
+
+<body>
+
+
+	<div class="cover">
+		<h1>Not Implemented <small>Error 501</small></h1>
+		<p class="lead">The Webserver cannot recognize the request method.</p>
+	</div>
+	
+</body>
+</html>

+ 51 - 0
Build/HTTP502.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	
+	<title>We've got some trouble | 502 - Webservice currently unavailable</title>
+	
+	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
+	
+	<style type="text/css">
+		html,body {
+			width: 100%;
+			height: 100%;
+			background-color: #21232a;
+		}
+		
+		body {
+			color: #fff;
+			text-align: center;
+			text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
+			padding: 0px;
+			min-height: 100%;
+			-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			display: table;
+		}
+
+		.lead {
+			color: #c0c0c0;
+		}
+		.cover {
+			display: table-cell;
+			vertical-align: middle;
+			padding: 0 20px;
+		}
+	</style>
+</head>
+
+<body>
+
+
+	<div class="cover">
+		<h1>Webservice currently unavailable <small>Error 502</small></h1>
+		<p class="lead">We've got some trouble with our backend upstream cluster.<br />
+Our service team has been dispatched to bring it back online.</p>
+	</div>
+	
+</body>
+</html>

+ 51 - 0
Build/HTTP503.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	
+	<title>We've got some trouble | 503 - Webservice currently unavailable</title>
+	
+	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
+	
+	<style type="text/css">
+		html,body {
+			width: 100%;
+			height: 100%;
+			background-color: #21232a;
+		}
+		
+		body {
+			color: #fff;
+			text-align: center;
+			text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
+			padding: 0px;
+			min-height: 100%;
+			-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			display: table;
+		}
+
+		.lead {
+			color: #c0c0c0;
+		}
+		.cover {
+			display: table-cell;
+			vertical-align: middle;
+			padding: 0 20px;
+		}
+	</style>
+</head>
+
+<body>
+
+
+	<div class="cover">
+		<h1>Webservice currently unavailable <small>Error 503</small></h1>
+		<p class="lead">We've got some trouble with our backend upstream cluster.<br />
+Our service team has been dispatched to bring it back online.</p>
+	</div>
+	
+</body>
+</html>

+ 50 - 0
Build/HTTP520.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	
+	<title>We've got some trouble | 520 - Origin Error - Unknown Host</title>
+	
+	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
+	
+	<style type="text/css">
+		html,body {
+			width: 100%;
+			height: 100%;
+			background-color: #21232a;
+		}
+		
+		body {
+			color: #fff;
+			text-align: center;
+			text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
+			padding: 0px;
+			min-height: 100%;
+			-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			display: table;
+		}
+
+		.lead {
+			color: #c0c0c0;
+		}
+		.cover {
+			display: table-cell;
+			vertical-align: middle;
+			padding: 0 20px;
+		}
+	</style>
+</head>
+
+<body>
+
+
+	<div class="cover">
+		<h1>Origin Error - Unknown Host <small>Error 520</small></h1>
+		<p class="lead">The requested hostname is not routed. Use only hostnames to access resources.</p>
+	</div>
+	
+</body>
+</html>

+ 51 - 0
Build/HTTP521.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	
+	<title>We've got some trouble | 521 - Webservice currently unavailable</title>
+	
+	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
+	
+	<style type="text/css">
+		html,body {
+			width: 100%;
+			height: 100%;
+			background-color: #21232a;
+		}
+		
+		body {
+			color: #fff;
+			text-align: center;
+			text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
+			padding: 0px;
+			min-height: 100%;
+			-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			display: table;
+		}
+
+		.lead {
+			color: #c0c0c0;
+		}
+		.cover {
+			display: table-cell;
+			vertical-align: middle;
+			padding: 0 20px;
+		}
+	</style>
+</head>
+
+<body>
+
+
+	<div class="cover">
+		<h1>Webservice currently unavailable <small>Error 521</small></h1>
+		<p class="lead">We've got some trouble with our backend upstream cluster.<br />
+Our service team has been dispatched to bring it back online.</p>
+	</div>
+	
+</body>
+</html>

+ 24 - 0
LICENSE.md

@@ -0,0 +1,24 @@
+The MIT License (X11 License)
+
+Copyright (c) 2014-2015 Andi Dittrich
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

+ 31 - 0
README.md

@@ -0,0 +1,31 @@
+# Bootstrap based HttpErrorPages #
+Simple, [Bootstrap](http://getbootstrap.com/) based HTTP Error Page Generator.
+
+Naming-Scheme: **HTTP**__<CODE>__**.html**
+
+## Customization ##
+To customize the pages, you can edit the **template.phtml** file and add your own styles. Finally run the generator-script.
+If you wan't to add custom pages/additional error-codes, just put a new entry into the `pages.php` file. The generator-script will process each entry and generates an own page.
+
+#### Custom Page Example (pages.php) ####
+
+```php
+// webserver origin error
+'520' => array(
+	'title' => 'Origin Error - Unknown Host',
+	'message' => 'The requested hostname is not routed. Use only hostnames to access resources.'
+),		
+```
+
+### Build/Generator ###
+To generate the static html pages, run the `generator.php` script:
+
+```shell
+php generator.php
+```
+
+All generated html files are located into the `Build/` directory.
+
+
+## License ##
+HttpErrorsPages is OpenSource and licensed under the Terms of [The MIT License (X11)](http://opensource.org/licenses/MIT) - your're welcome to contribute

+ 24 - 0
generator.php

@@ -0,0 +1,24 @@
+<?php
+/**
+ * HttpErrorPages HTML Generator
+ */
+
+// load pages
+$pages = require('pages.php');
+
+// load template
+$tpl = file_get_contents('template.html');
+
+// generate each error page
+foreach ($pages as $code => $page){
+	// copy template
+	$errorpage = $tpl;
+	
+	// assign variables
+	$errorpage = str_replace('{{CODE}}', intval($code), $errorpage);
+	$errorpage = str_replace('{{TITLE}}', nl2br(htmlspecialchars($page['title'])), $errorpage);
+	$errorpage = str_replace('{{MESSAGE}}', nl2br(htmlspecialchars($page['message'])), $errorpage);
+	
+	// store template
+	file_put_contents('Build/HTTP'.intval($code).'.html', $errorpage);
+}

+ 60 - 0
pages.php

@@ -0,0 +1,60 @@
+<?php
+return array (
+		
+		'400' => array (
+				'title' => 'Bad Request',
+				'message' => 'The server cannot process the request due to something that is perceived to be a client error.' 
+		),
+		'401' => array (
+				'title' => 'Unauthorized',
+				'message' => 'The requested resource requires an authentication.'
+		),
+
+		'403' => array (
+				'title' => 'Access Denied',
+				'message' => 'The requested resource requires an authentication.' 
+		),
+		
+		// http 404 not found
+		'404' => array (
+				'title' => 'Resource not found',
+				'message' => 'The requested resource could not be found but may be available again in the future.' 
+		),
+		
+		// internal server error
+		'500' => array (
+				'title' => 'Webservice currently unavailable',
+				'message' => "An unexpected condition was encountered.\nOur service team has been dispatched to bring it back online." 
+		),
+		
+		// unknown http method
+		'501' => array (
+				'title' => 'Not Implemented',
+				'message' => 'The Webserver cannot recognize the request method.'
+		),
+		
+		// http proxy forward error
+		'502' => array (
+				'title' => 'Webservice currently unavailable',
+				'message' => "We've got some trouble with our backend upstream cluster.\nOur service team has been dispatched to bring it back online."
+		),
+		
+		// webserver service error
+		'503' => array (
+				'title' => 'Webservice currently unavailable',
+				'message' => "We've got some trouble with our backend upstream cluster.\nOur service team has been dispatched to bring it back online."
+		),
+		
+		// webserver origin error
+		'520' => array(
+			'title' => 'Origin Error - Unknown Host',
+			'message' => 'The requested hostname is not routed. Use only hostnames to access resources.'
+		),
+		
+		// webserver down error
+		'521' => array (
+				'title' => 'Webservice currently unavailable',
+				'message' => "We've got some trouble with our backend upstream cluster.\nOur service team has been dispatched to bring it back online."
+		)
+)
+;

+ 50 - 0
template.html

@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+	<meta charset="utf-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	
+	<title>We've got some trouble | {{CODE}} - {{TITLE}}</title>
+	
+	<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
+	
+	<style type="text/css">
+		html,body {
+			width: 100%;
+			height: 100%;
+			background-color: #21232a;
+		}
+		
+		body {
+			color: #fff;
+			text-align: center;
+			text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
+			padding: 0px;
+			min-height: 100%;
+			-webkit-box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			box-shadow: inset 0 0 100px rgba(0, 0, 0, .8);
+			display: table;
+		}
+
+		.lead {
+			color: #c0c0c0;
+		}
+		.cover {
+			display: table-cell;
+			vertical-align: middle;
+			padding: 0 20px;
+		}
+	</style>
+</head>
+
+<body>
+
+
+	<div class="cover">
+		<h1>{{TITLE}} <small>Error {{CODE}}</small></h1>
+		<p class="lead">{{MESSAGE}}</p>
+	</div>
+	
+</body>
+</html>