Skip to content

Commit

Permalink
Merge branch 'MDL-57432-master' of git://github.com/danpoltawski/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Jul 11, 2017
2 parents e578ab1 + f83d212 commit f84bdb4
Show file tree
Hide file tree
Showing 117 changed files with 328 additions and 3,992 deletions.
14 changes: 5 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ language: php
php:
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
- 7.1
- 5.6
- 7.0

addons:
postgresql: "9.3"
Expand Down Expand Up @@ -65,11 +65,7 @@ matrix:
# Exclude it on all versions except for 7.1

- env: DB=mysqli TASK=PHPUNIT
php: 5.6

# Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
- env: DB=pgsql TASK=UPGRADE
php: 7.1
php: 7.0

cache:
directories:
Expand Down Expand Up @@ -233,9 +229,9 @@ before_script:
# We need the official upstream.
git remote add upstream https://github.com/moodle/moodle.git;
# Checkout 27 STABLE branch.
git fetch upstream MOODLE_27_STABLE;
git checkout MOODLE_27_STABLE;
# Checkout 30 STABLE branch (the first version compatible with PHP 7.x)
git fetch upstream MOODLE_30_STABLE;
git checkout MOODLE_30_STABLE;
# Perform the upgrade
php admin/cli/install_database.php --agree-license --adminpass=Password --adminemail=admin@example.com --fullname="Upgrade test" --shortname=Upgrade;
Expand Down
11 changes: 3 additions & 8 deletions admin/cli/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,9 @@

define('IGNORE_COMPONENT_CACHE', true);

// Check that PHP is of a sufficient version
if (version_compare(phpversion(), "5.6.5") < 0) {
$phpversion = phpversion();
// do NOT localise - lang strings would not work here and we CAN NOT move it after installib
fwrite(STDERR, "Moodle 3.2 or later requires at least PHP 5.6.5 (currently using version $phpversion).\n");
fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
exit(1);
}
// Check that PHP is of a sufficient version as soon as possible.
require_once(__DIR__.'/../../lib/phpminimumversionlib.php');
moodle_require_minimum_php_version();

// set up configuration
global $CFG;
Expand Down
11 changes: 3 additions & 8 deletions admin/cli/install_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,9 @@
\$sudo -u www-data /usr/bin/php admin/cli/install_database.php --lang=cs --adminpass=soMePass123 --agree-license
";

// Check that PHP is of a sufficient version
if (version_compare(phpversion(), "5.6.5") < 0) {
$phpversion = phpversion();
// do NOT localise - lang strings would not work here and we CAN NOT move it after installib
fwrite(STDERR, "Moodle 3.2 or later requires at least PHP 5.6.5 (currently using version $phpversion).\n");
fwrite(STDERR, "Please upgrade your server software or install older Moodle version.\n");
exit(1);
}
// Check that PHP is of a sufficient version as soon as possible.
require_once(__DIR__.'/../../lib/phpminimumversionlib.php');
moodle_require_minimum_php_version();

// Nothing to do if config.php does not exist
$configfile = __DIR__.'/../../config.php';
Expand Down
176 changes: 176 additions & 0 deletions admin/environment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2081,4 +2081,180 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.4" requires="3.0">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.3" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="7.0.0" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="required">
<FEEDBACK>
<ON_ERROR message="opensslrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlreader" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="required">
<FEEDBACK>
<ON_ERROR message="intlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
<PHP_EXTENSION name="fileinfo" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
<FEEDBACK>
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfileformat" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbfilepertable" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddblargeprefix" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
<FEEDBACK>
<ON_CHECK message="ishttpswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
<FEEDBACK>
<ON_CHECK message="incompleteunicodesupport" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
11 changes: 3 additions & 8 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,9 @@
die();
}

// Check that PHP is of a sufficient version as soon as possible
if (version_compare(phpversion(), '5.6.5') < 0) {
$phpversion = phpversion();
// do NOT localise - lang strings would not work here and we CAN NOT move it to later place
echo "Moodle 3.2 or later requires at least PHP 5.6.5 (currently using version $phpversion).<br />";
echo "Please upgrade your server software or install older Moodle version.";
die();
}
// Check that PHP is of a sufficient version as soon as possible.
require_once(__DIR__.'/../lib/phpminimumversionlib.php');
moodle_require_minimum_php_version();

// make sure iconv is available and actually works
if (!function_exists('iconv')) {
Expand Down
9 changes: 0 additions & 9 deletions admin/tool/customlang/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@
function xmldb_tool_customlang_upgrade($oldversion) {
global $CFG;

// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v2.9.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions admin/tool/log/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,6 @@
function xmldb_tool_log_upgrade($oldversion) {
global $CFG;

// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v2.9.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
9 changes: 0 additions & 9 deletions admin/tool/log/store/database/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@
function xmldb_logstore_database_upgrade($oldversion) {
global $CFG;

// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v2.9.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
28 changes: 1 addition & 27 deletions admin/tool/log/store/standard/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,7 @@
defined('MOODLE_INTERNAL') || die();

function xmldb_logstore_standard_upgrade($oldversion) {
global $CFG, $DB;

$dbman = $DB->get_manager();

// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v2.9.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.

if ($oldversion < 2016041200) {
// This could take a long time. Unfortunately, no way to know how long, and no way to do progress, so setting for 1 hour.
upgrade_set_timeout(3600);

// Define key contextid (foreign) to be added to logstore_standard_log.
$table = new xmldb_table('logstore_standard_log');
$key = new xmldb_key('contextid', XMLDB_KEY_FOREIGN, array('contextid'), 'context', array('id'));

// Launch add key contextid.
$dbman->add_key($table, $key);

// Standard savepoint reached.
upgrade_plugin_savepoint(true, 2016041200, 'logstore', 'standard');
}
global $CFG;

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
Expand Down
26 changes: 1 addition & 25 deletions admin/tool/monitor/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,10 @@
* @return bool always true
*/
function xmldb_tool_monitor_upgrade($oldversion) {
global $DB;
global $CFG, $DB;

$dbman = $DB->get_manager();

if ($oldversion < 2014102000) {

// Define field lastnotificationsent to be added to tool_monitor_subscriptions.
$table = new xmldb_table('tool_monitor_subscriptions');
$field = new xmldb_field('lastnotificationsent', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0', 'timecreated');

// Conditionally launch add field lastnotificationsent.
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}

// Monitor savepoint reached.
upgrade_plugin_savepoint(true, 2014102000, 'tool', 'monitor');
}

// Moodle v2.8.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v2.9.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v3.0.0 release upgrade line.
// Put any upgrade step following this.

// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.

Expand Down
Loading

0 comments on commit f84bdb4

Please sign in to comment.