config.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. if (!isset($_SERVER['HTTP_HOST'])) {
  3. exit('This script cannot be run from the CLI. Run it from a browser.');
  4. }
  5. if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
  6. '127.0.0.1',
  7. '::1',
  8. ))) {
  9. header('HTTP/1.0 403 Forbidden');
  10. exit('This script is only accessible from localhost.');
  11. }
  12. require_once dirname(__FILE__).'/../app/SymfonyRequirements.php';
  13. $symfonyRequirements = new SymfonyRequirements();
  14. $majorProblems = $symfonyRequirements->getFailedRequirements();
  15. $minorProblems = $symfonyRequirements->getFailedRecommendations();
  16. ?>
  17. <!DOCTYPE html>
  18. <html>
  19. <head>
  20. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  21. <meta name="robots" content="noindex,nofollow" />
  22. <title>Symfony Configuration</title>
  23. <link rel="stylesheet" href="bundles/framework/css/structure.css" media="all" />
  24. <link rel="stylesheet" href="bundles/framework/css/body.css" media="all" />
  25. <link rel="stylesheet" href="bundles/sensiodistribution/webconfigurator/css/install.css" media="all" />
  26. </head>
  27. <body>
  28. <div id="content">
  29. <div class="header clear-fix">
  30. <div class="header-logo">
  31. <img src="bundles/framework/images/logo_symfony.png" alt="Symfony" />
  32. </div>
  33. <div class="search">
  34. <form method="get" action="http://symfony.com/search">
  35. <div class="form-row">
  36. <label for="search-id">
  37. <img src="bundles/framework/images/grey_magnifier.png" alt="Search on Symfony website" />
  38. </label>
  39. <input name="q" id="search-id" type="search" placeholder="Search on Symfony website" />
  40. <button type="submit" class="sf-button">
  41. <span class="border-l">
  42. <span class="border-r">
  43. <span class="btn-bg">OK</span>
  44. </span>
  45. </span>
  46. </button>
  47. </div>
  48. </form>
  49. </div>
  50. </div>
  51. <div class="sf-reset">
  52. <div class="block">
  53. <div class="symfony-block-content">
  54. <h1 class="title">Welcome!</h1>
  55. <p>Welcome to your new Symfony project.</p>
  56. <p>
  57. This script will guide you through the basic configuration of your project.
  58. You can also do the same by editing the ‘<strong>app/config/parameters.yml</strong>’ file directly.
  59. </p>
  60. <?php if (count($majorProblems)): ?>
  61. <h2 class="ko">Major problems</h2>
  62. <p>Major problems have been detected and <strong>must</strong> be fixed before continuing:</p>
  63. <ol>
  64. <?php foreach ($majorProblems as $problem): ?>
  65. <li><?php echo $problem->getHelpHtml() ?></li>
  66. <?php endforeach; ?>
  67. </ol>
  68. <?php endif; ?>
  69. <?php if (count($minorProblems)): ?>
  70. <h2>Recommendations</h2>
  71. <p>
  72. <?php if (count($majorProblems)): ?>Additionally, to<?php else: ?>To<?php endif; ?> enhance your Symfony experience,
  73. it’s recommended that you fix the following:
  74. </p>
  75. <ol>
  76. <?php foreach ($minorProblems as $problem): ?>
  77. <li><?php echo $problem->getHelpHtml() ?></li>
  78. <?php endforeach; ?>
  79. </ol>
  80. <?php endif; ?>
  81. <?php if ($symfonyRequirements->hasPhpIniConfigIssue()): ?>
  82. <p id="phpini">*
  83. <?php if ($symfonyRequirements->getPhpIniConfigPath()): ?>
  84. Changes to the <strong>php.ini</strong> file must be done in "<strong><?php echo $symfonyRequirements->getPhpIniConfigPath() ?></strong>".
  85. <?php else: ?>
  86. To change settings, create a "<strong>php.ini</strong>".
  87. <?php endif; ?>
  88. </p>
  89. <?php endif; ?>
  90. <?php if (!count($majorProblems) && !count($minorProblems)): ?>
  91. <p class="ok">Your configuration looks good to run Symfony.</p>
  92. <?php endif; ?>
  93. <ul class="symfony-install-continue">
  94. <?php if (!count($majorProblems)): ?>
  95. <li><a href="app_dev.php/_configurator/">Configure your Symfony Application online</a></li>
  96. <li><a href="app_dev.php/">Bypass configuration and go to the Welcome page</a></li>
  97. <?php endif; ?>
  98. <?php if (count($majorProblems) || count($minorProblems)): ?>
  99. <li><a href="config.php">Re-check configuration</a></li>
  100. <?php endif; ?>
  101. </ul>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="version">Symfony Standard Edition</div>
  106. </div>
  107. </body>
  108. </html>