MDL-43213 fix init regression and remove $checkphp parameter

This commit is contained in:
Petr Skoda 2013-12-19 12:29:05 +08:00 committed by David Monllao
parent a0e1168751
commit 9bb80d2005
6 changed files with 33 additions and 23 deletions

View file

@ -100,10 +100,9 @@ class behat_command {
* It checks behat dependencies have been installed and runs
* the behat help command to ensure it works as expected
*
* @param bool $checkphp Extra check for the PHP version
* @return int Error code or 0 if all ok
*/
public static function behat_setup_problem($checkphp = false) {
public static function behat_setup_problem() {
global $CFG;
$clibehaterrorstr = "Behat dependencies not installed. Ensure you ran the composer installer. " . self::DOCS_URL . "#Installation\n";

View file

@ -196,7 +196,7 @@ class behat_util extends testing_util {
}
// Checks the behat set up and the PHP version.
if ($errorcode = behat_command::behat_setup_problem(true)) {
if ($errorcode = behat_command::behat_setup_problem()) {
exit($errorcode);
}
@ -230,7 +230,7 @@ class behat_util extends testing_util {
}
// Checks the behat set up and the PHP version, returning an error code if something went wrong.
if ($errorcode = behat_command::behat_setup_problem(true)) {
if ($errorcode = behat_command::behat_setup_problem()) {
return $errorcode;
}

View file

@ -211,6 +211,7 @@ function behat_check_config_vars() {
}
if (!file_exists($CFG->behat_dataroot)) {
$permissions = isset($CFG->directorypermissions) ? $CFG->directorypermissions : 02777;
umask(0);
if (!mkdir($CFG->behat_dataroot, $permissions, true)) {
behat_error(BEHAT_EXITCODE_PERMISSIONS, '$CFG->behat_dataroot directory can not be created');
}