|
| 1 | +<?php |
| 2 | + |
| 3 | +if (!isset($_SERVER['HTTP_HOST'])) { |
| 4 | + exit('This script cannot be run from the console. Run it from a browser.'); |
| 5 | +} |
| 6 | + |
| 7 | +if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1'))) { |
| 8 | + header('HTTP/1.0 403 Forbidden'); |
| 9 | + exit('This script is only accessible from localhost.'); |
| 10 | +} |
| 11 | + |
| 12 | +require_once dirname(__FILE__).'/../app/SymfonyRequirements.php'; |
| 13 | + |
| 14 | +$symfonyRequirements = new SymfonyRequirements(); |
| 15 | + |
| 16 | +$majorProblems = $symfonyRequirements->getFailedRequirements(); |
| 17 | +$minorProblems = $symfonyRequirements->getFailedRecommendations(); |
| 18 | + |
| 19 | +?> |
| 20 | + |
| 21 | +<!DOCTYPE html> |
| 22 | +<html> |
| 23 | + <head> |
| 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" /> |
| 28 | + </head> |
| 29 | + |
| 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 |
| 37 | + </span> |
| 38 | + </div> |
| 39 | + </div> |
| 40 | + </div> |
| 41 | + </header> |
| 42 | + |
| 43 | + <div class="container body-container"> |
| 44 | + <div class="row"> |
| 45 | + <div id="main" class="col-sm-9"> |
| 46 | + <div class="row"> |
| 47 | + <?php if (count($majorProblems)): ?> |
| 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> |
| 65 | + <?php endif; ?> |
| 66 | + |
| 67 | + <?php if (count($minorProblems)): ?> |
| 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> |
| 85 | + <?php endif; ?> |
| 86 | + |
| 87 | + <?php if ($symfonyRequirements->hasPhpIniConfigIssue()): ?> |
| 88 | + <p id="phpini">* |
| 89 | + <?php if ($symfonyRequirements->getPhpIniConfigPath()): ?> |
| 90 | + Changes to the <strong>php.ini</strong> file must be done in the "<strong><?php echo $symfonyRequirements->getPhpIniConfigPath() ?></strong>" file. |
| 91 | + <?php else: ?> |
| 92 | + To change settings, create a "<strong>php.ini</strong>". |
| 93 | + <?php endif; ?> |
| 94 | + </p> |
| 95 | + <?php endif; ?> |
| 96 | + |
| 97 | + <?php if (!count($majorProblems) && !count($minorProblems)): ?> |
| 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> |
| 109 | + <?php endif; ?> |
| 110 | + </div> |
| 111 | + </div> |
| 112 | + |
| 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> |
| 127 | + </div> |
| 128 | + |
| 129 | + </div> |
| 130 | + </div> |
| 131 | + </div> |
| 132 | + |
| 133 | + <footer> |
| 134 | + <div class="container"> |
| 135 | + <div class="row"> |
| 136 | + <div id="footer-copyright" class="col-md-6"> |
| 137 | + <p>© 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> |
| 150 | + </body> |
| 151 | +</html> |
0 commit comments