Skip to content

Commit

Permalink
MDL-59152 mlbackend_php: Check PHP version
Browse files Browse the repository at this point in the history
Part of MDL-57791 epic.
  • Loading branch information
David Monllao committed Jul 24, 2017
1 parent ad7a4d3 commit db3252c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/mlbackend/php/classes/processor.php
Expand Up @@ -55,6 +55,9 @@ class processor implements \core_analytics\predictor {
protected $limitedsize = false;

public function is_ready() {
if (version_compare(phpversion(), '7.0.0') < 0) {
return get_string('errorphp7required', 'mlbackend_php');
}
return true;
}

Expand Down
7 changes: 4 additions & 3 deletions lib/mlbackend/php/lang/en/mlbackend_php.php
@@ -1,7 +1,8 @@
<?php

$string['pluginname'] = 'PHP predictor';
$string['datasetsizelimited'] = 'Only a part of the evaluation dataset has been evaluated due to its size. Set $CFG->mlbackend_php_no_memory_limit if you are confident that your system can cope a {$a} dataset';
$string['errorcantloadmodel'] = 'Model file {$a} does not exist, ensure the model has been trained before using it to predict.';
$string['errornotenoughdata'] = 'The evaluation results varied too much, you could try to gather more data to ensure the model is valid. Evaluation results standard deviation = {$a->deviation}, maximum recommended standard deviation = {$a->accepteddeviation}';
$string['errorlowscore'] = 'The evaluated model prediction accuracy is not very high, some predictions may not be accurate. Model score = {$a->score}, minimum score = {$a->minscore}';
$string['datasetsizelimited'] = 'Only a part of the evaluation dataset has been evaluated due to its size. Set $CFG->mlbackend_php_no_memory_limit if you are confident that your system can cope a {$a} dataset';
$string['errornotenoughdata'] = 'The evaluation results varied too much, you could try to gather more data to ensure the model is valid. Evaluation results standard deviation = {$a->deviation}, maximum recommended standard deviation = {$a->accepteddeviation}';
$string['errorphp7required'] = 'The PHP machine learning backend requires PHP 7';
$string['pluginname'] = 'PHP machine learning backend';

0 comments on commit db3252c

Please sign in to comment.