Travis: check installation

pull/3064/head
Julio 6 years ago
parent bb27f88779
commit a4d605635d
  1. 2
      .travis.yml
  2. 9
      public/check.php

@ -80,13 +80,13 @@ install:
script: script:
- composer analyse - composer analyse
- curl $VHOST_URL/check.php
- cd tests/behat - cd tests/behat
# - travis_wait 45 ../../vendor/behat/behat/bin/behat -v # - travis_wait 45 ../../vendor/behat/behat/bin/behat -v
- ../../vendor/behat/behat/bin/behat features/actionInstall.feature - ../../vendor/behat/behat/bin/behat features/actionInstall.feature
- ../../vendor/behat/behat/bin/behat features/adminFillUsers.feature - ../../vendor/behat/behat/bin/behat features/adminFillUsers.feature
- ../../vendor/behat/behat/bin/behat features/course.feature - ../../vendor/behat/behat/bin/behat features/course.feature
- ../../vendor/behat/behat/bin/behat features/createUser.feature - ../../vendor/behat/behat/bin/behat features/createUser.feature
- curl $VHOST_URL
# - sudo cat /var/log/apache2/$VHOST_URL-access.log # - sudo cat /var/log/apache2/$VHOST_URL-access.log
after_failure: after_failure:

@ -12,15 +12,15 @@
use Symfony\Requirements\SymfonyRequirements; use Symfony\Requirements\SymfonyRequirements;
if (!isset($_SERVER['HTTP_HOST'])) { if (!isset($_SERVER['HTTP_HOST'])) {
exit("This script cannot be run from the CLI. Run it from a browser.\n"); // exit("This script cannot be run from the CLI. Run it from a browser.\n");
} }
if (!in_array(@$_SERVER['REMOTE_ADDR'], array( if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1', '127.0.0.1',
'::1', '::1',
))) { ))) {
header('HTTP/1.0 403 Forbidden'); //header('HTTP/1.0 403 Forbidden');
exit('This script is only accessible from localhost.'); //exit('This script is only accessible from localhost.');
} }
if (file_exists($autoloader = __DIR__.'/../../../autoload.php')) { if (file_exists($autoloader = __DIR__.'/../../../autoload.php')) {
@ -32,11 +32,8 @@ if (file_exists($autoloader = __DIR__.'/../../../autoload.php')) {
} }
$symfonyVersion = class_exists('\Symfony\Component\HttpKernel\Kernel') ? \Symfony\Component\HttpKernel\Kernel::VERSION : null; $symfonyVersion = class_exists('\Symfony\Component\HttpKernel\Kernel') ? \Symfony\Component\HttpKernel\Kernel::VERSION : null;
$symfonyRequirements = new SymfonyRequirements(dirname(dirname(realpath($autoloader))), $symfonyVersion); $symfonyRequirements = new SymfonyRequirements(dirname(dirname(realpath($autoloader))), $symfonyVersion);
$symfonyRequirements->addPhpConfigRequirement();
$majorProblems = $symfonyRequirements->getFailedRequirements(); $majorProblems = $symfonyRequirements->getFailedRequirements();
$minorProblems = $symfonyRequirements->getFailedRecommendations(); $minorProblems = $symfonyRequirements->getFailedRecommendations();
$hasMajorProblems = (bool) count($majorProblems); $hasMajorProblems = (bool) count($majorProblems);

Loading…
Cancel
Save