From a523d8c25f60a028d818e785e31b3ac61587a3fd Mon Sep 17 00:00:00 2001 From: Julio Date: Thu, 19 Dec 2019 14:06:40 +0100 Subject: [PATCH] Travis: debug installation --- .travis.yml | 1 - public/main/install/index.php | 10 ++++++++++ public/main/install/install.lib.php | 1 + tests/behat/features/actionInstall.feature | 3 ++- tests/travis/travis-apache | 4 ---- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index fdf4dc74f2..31a62baab7 100755 --- a/.travis.yml +++ b/.travis.yml @@ -80,7 +80,6 @@ install: script: - composer analyse - - curl $VHOST_URL/check.php - cd tests/behat # - travis_wait 45 ../../vendor/behat/behat/bin/behat -v - ../../vendor/behat/behat/bin/behat features/actionInstall.feature diff --git a/public/main/install/index.php b/public/main/install/index.php index 0fbffa68a9..5efb869808 100644 --- a/public/main/install/index.php +++ b/public/main/install/index.php @@ -269,6 +269,8 @@ if (!$_POST) { $current_step = 7; } +error_log("Step: $current_step"); + // Managing the $encryptPassForm if ($encryptPassForm == '1') { $encryptPassForm = 'bcrypt'; @@ -582,6 +584,8 @@ if (isset($_POST['step2'])) { error_log('Set upgradeWithContainer'); } else { set_file_folder_permissions(); + error_log("connectToDatabase as user $dbUsernameForm"); + $database = connectToDatabase( $dbHostForm, $dbUsernameForm, @@ -593,8 +597,12 @@ if (isset($_POST['step2'])) { $dbNameForm = preg_replace('/[^a-zA-Z0-9_\-]/', '', $dbNameForm); // Drop and create the database anyways + error_log("Drop database $dbNameForm"); + $manager->getConnection()->getSchemaManager()->dropAndCreateDatabase($dbNameForm); + error_log("Connect to database $dbNameForm with user $dbUsernameForm"); + $database = connectToDatabase( $dbHostForm, $dbUsernameForm, @@ -622,11 +630,13 @@ if (isset($_POST['step2'])) { updateEnvFile($distFile, $envFile, $params); (new Dotenv())->load($envFile); + error_log("Boot kernel"); // Load Symfony Kernel $kernel = new Kernel('dev', true); $application = new Application($kernel); // Create database + error_log("Create database"); $input = new ArrayInput([]); $command = $application->find('doctrine:schema:create'); $result = $command->run($input, new ConsoleOutput()); diff --git a/public/main/install/install.lib.php b/public/main/install/install.lib.php index d9adf6be90..509eb977d0 100644 --- a/public/main/install/install.lib.php +++ b/public/main/install/install.lib.php @@ -2840,6 +2840,7 @@ function updateEnvFile($distFile, $envFile, $params) $contents = file_get_contents($distFile); $contents = str_replace(array_keys($params), array_values($params), $contents); file_put_contents($envFile, $contents); + error_log("File env saved here: $envFile"); } /** diff --git a/tests/behat/features/actionInstall.feature b/tests/behat/features/actionInstall.feature index 6c6737d7d4..f7c24b2e80 100644 --- a/tests/behat/features/actionInstall.feature +++ b/tests/behat/features/actionInstall.feature @@ -23,7 +23,8 @@ Feature: Install portal | passForm | admin | Then I press "step5" Then I should see "Last check before install" - Then I press "Install chamilo" + Then wait the page to be loaded when ready + Then I press "button_step6" Then wait the page to be loaded when ready Then I should see "Step7" diff --git a/tests/travis/travis-apache b/tests/travis/travis-apache index f7bbcda137..36858ecd7f 100644 --- a/tests/travis/travis-apache +++ b/tests/travis/travis-apache @@ -8,10 +8,6 @@ Require all granted - #ErrorLog ${APACHE_LOG_DIR}/%VHOST_URL%-error.log - LogLevel notice - #CustomLog ${APACHE_LOG_DIR}/%VHOST_URL%-access.log combined - AddHandler php5-fcgi .php Action php5-fcgi /php5-fcgi