Skip to content

Commit 2295159

Browse files
committed
Add check.php file for access from web
1 parent 2128178 commit 2295159

File tree

3 files changed

+122
-73
lines changed

3 files changed

+122
-73
lines changed

app/Resources/assets/scss/main.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,26 @@ footer {
154154
}
155155
}
156156

157+
//
158+
// Page: 'Technical Requirements Checker'
159+
// --------------------------------------------------
160+
body#requirements_checker {
161+
header h1 {
162+
margin-bottom: 0;
163+
margin-top: 0;
164+
165+
span {
166+
font-size: 120%;
167+
opacity: .7;
168+
padding: 0 5px;
169+
}
170+
}
171+
172+
.panel li {
173+
margin-bottom: 1em;
174+
}
175+
}
176+
157177
//
158178
// Page: 'homepage'
159179
// --------------------------------------------------

web/check.php

Lines changed: 100 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<?php
22

33
if (!isset($_SERVER['HTTP_HOST'])) {
4-
exit('This script cannot be run from the CLI. Run it from a browser.');
4+
exit('This script cannot be run from the console. Run it from a browser.');
55
}
66

7-
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
8-
'127.0.0.1',
9-
'::1',
10-
))) {
7+
if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) {
118
header('HTTP/1.0 403 Forbidden');
129
exit('This script is only accessible from localhost.');
1310
}
@@ -20,103 +17,135 @@
2017
$minorProblems = $symfonyRequirements->getFailedRecommendations();
2118

2219
?>
20+
2321
<!DOCTYPE html>
2422
<html>
2523
<head>
26-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
27-
<meta name="robots" content="noindex,nofollow" />
28-
<title>Symfony Configuration</title>
29-
<link rel="stylesheet" href="bundles/framework/css/structure.css" media="all" />
30-
<link rel="stylesheet" href="bundles/framework/css/body.css" media="all" />
31-
<link rel="stylesheet" href="bundles/sensiodistribution/webconfigurator/css/install.css" media="all" />
24+
<meta charset="UTF-8" />
25+
<title>Symfony Demo Application</title>
26+
<link rel="stylesheet" href="/css/app.css">
27+
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
3228
</head>
33-
<body>
34-
<div id="content">
35-
<div class="header clear-fix">
36-
<div class="header-logo">
37-
<img src="bundles/framework/images/logo_symfony.png" alt="Symfony" />
38-
</div>
39-
40-
<div class="search">
41-
<form method="get" action="http://symfony.com/search">
42-
<div class="form-row">
4329

44-
<label for="search-id">
45-
<img src="bundles/framework/images/grey_magnifier.png" alt="Search on Symfony website" />
46-
</label>
47-
48-
<input name="q" id="search-id" type="search" placeholder="Search on Symfony website" />
49-
50-
<button type="submit" class="sf-button">
51-
<span class="border-l">
52-
<span class="border-r">
53-
<span class="btn-bg">OK</span>
54-
</span>
30+
<body id="requirements_checker">
31+
<header>
32+
<div class="navbar navbar-default navbar-static-top" role="navigation">
33+
<div class="container">
34+
<div class="navbar-header">
35+
<h1 class="navbar-brand">
36+
Symfony Demo Application <span>/</span> Technical Requirements Checker
5537
</span>
56-
</button>
5738
</div>
58-
</form>
5939
</div>
6040
</div>
41+
</header>
6142

62-
<div class="sf-reset">
63-
<div class="block">
64-
<div class="symfony-block-content">
65-
<h1 class="title">Welcome!</h1>
66-
<p>Welcome to the <strong>Symfony Demo Application</strong>.</p>
67-
<p>
68-
This script will guide you through the required and optional environment configuration parameters for this project.
69-
</p>
70-
43+
<div class="container body-container">
44+
<div class="row">
45+
<div id="main" class="col-sm-9">
46+
<div class="row">
7147
<?php if (count($majorProblems)): ?>
72-
<h2 class="ko">Major problems</h2>
73-
<p>Major problems have been detected and <strong>must</strong> be fixed before continuing:</p>
74-
<ol>
75-
<?php foreach ($majorProblems as $problem): ?>
76-
<li><?php echo $problem->getHelpHtml() ?></li>
77-
<?php endforeach; ?>
78-
</ol>
48+
<div class="panel panel-danger">
49+
<div class="panel-heading">
50+
<h3 class="panel-title">
51+
<i class="fa fa-exclamation-circle"></i>
52+
Fix these problems before continuing
53+
</h3>
54+
</div>
55+
<div class="panel-body">
56+
<p>These <strong>mandatory requirements</strong> must be fixed before running Symfony applications:</p>
57+
58+
<ol>
59+
<?php foreach ($majorProblems as $problem): ?>
60+
<li><?php echo $problem->getHelpHtml() ?></li>
61+
<?php endforeach; ?>
62+
</ol>
63+
</div>
64+
</div>
7965
<?php endif; ?>
8066

8167
<?php if (count($minorProblems)): ?>
82-
<h2>Recommendations</h2>
83-
<p>
84-
<?php if (count($majorProblems)): ?>Additionally, to<?php else: ?>To<?php endif; ?> enhance your Symfony experience,
85-
it’s recommended that you fix the following:
86-
</p>
87-
<ol>
88-
<?php foreach ($minorProblems as $problem): ?>
89-
<li><?php echo $problem->getHelpHtml() ?></li>
90-
<?php endforeach; ?>
91-
</ol>
68+
<div class="panel panel-warning">
69+
<div class="panel-heading">
70+
<h3 class="panel-title">
71+
<i class="fa fa-exclamation-triangle"></i>
72+
Fix these problems to improve your experience
73+
</h3>
74+
</div>
75+
<div class="panel-body">
76+
<p>These <strong>optional requirements</strong> should be fixed to improve your experience running Symfony applications:</p>
77+
78+
<ol>
79+
<?php foreach ($minorProblems as $problem): ?>
80+
<li><?php echo $problem->getHelpHtml() ?></li>
81+
<?php endforeach; ?>
82+
</ol>
83+
</div>
84+
</div>
9285
<?php endif; ?>
9386

9487
<?php if ($symfonyRequirements->hasPhpIniConfigIssue()): ?>
9588
<p id="phpini">*
9689
<?php if ($symfonyRequirements->getPhpIniConfigPath()): ?>
97-
Changes to the <strong>php.ini</strong> file must be done in "<strong><?php echo $symfonyRequirements->getPhpIniConfigPath() ?></strong>".
90+
Changes to the <strong>php.ini</strong> file must be done in the "<strong><?php echo $symfonyRequirements->getPhpIniConfigPath() ?></strong>" file.
9891
<?php else: ?>
9992
To change settings, create a "<strong>php.ini</strong>".
10093
<?php endif; ?>
10194
</p>
10295
<?php endif; ?>
10396

10497
<?php if (!count($majorProblems) && !count($minorProblems)): ?>
105-
<p class="ok">Your configuration looks good to run Symfony Demo Application.</p>
98+
<div class="panel panel-success">
99+
<div class="panel-heading">
100+
<h3 class="panel-title">
101+
<i class="fa fa-check"></i>
102+
All checks passed successfully
103+
</h3>
104+
</div>
105+
<div class="panel-body">
106+
<p>Your configuration looks good to run the Symfony Demo application.</p>
107+
</div>
108+
</div>
106109
<?php endif; ?>
110+
</div>
111+
</div>
107112

108-
<ul class="symfony-install-continue">
109-
<?php if (!count($majorProblems)): ?>
110-
<li><a href="app_dev.php/">Go to the Welcome page</a></li>
111-
<?php endif; ?>
112-
<?php if (count($majorProblems) || count($minorProblems)): ?>
113-
<li><a href="config.php">Re-check configuration</a></li>
114-
<?php endif; ?>
115-
</ul>
113+
<div id="sidebar" class="col-sm-3">
114+
<div class="section about">
115+
<div class="well well-lg">
116+
<p>
117+
This script checks whether your system meets the
118+
technical requirements for running Symfony
119+
applications.
120+
</p>
121+
<p>
122+
For more information, check out the
123+
<a href="http://symfony.com/doc/current/reference/requirements.html">requirements list</a>
124+
at the Symfony documentation.
125+
</p>
126+
</div>
116127
</div>
128+
117129
</div>
118130
</div>
119-
<div class="version">Symfony Demo Application</div>
120131
</div>
132+
133+
<footer>
134+
<div class="container">
135+
<div class="row">
136+
<div id="footer-copyright" class="col-md-6">
137+
<p>&copy; 2015 - The Symfony Project</p>
138+
<p>MIT License</p>
139+
</div>
140+
<div id="footer-resources" class="col-md-6">
141+
<p>
142+
<a href="https://twitter.com/symfony"><i class="fa fa-twitter"></i></a>
143+
<a href="https://www.facebook.com/SensioLabs"><i class="fa fa-facebook"></i></a>
144+
<a href="http://symfony.com/blog"><i class="fa fa-rss"></i></a>
145+
</p>
146+
</div>
147+
</div>
148+
</div>
149+
</footer>
121150
</body>
122151
</html>

web/css/app.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)