This commit is contained in:
David Monllao 2016-10-25 15:20:06 +08:00
commit ab9ca549e7

View File

@ -536,6 +536,11 @@ class cache_phpunit_factory extends cache_factory {
parent::disable();
}
/**
* @var bool Whether the warning notice about alternative cache store used has been displayed.
*/
protected $altcachestorenotice = false;
/**
* Creates a store instance given its name and configuration.
*
@ -559,7 +564,15 @@ class cache_phpunit_factory extends cache_factory {
return $instance;
}
}
// Notify user that alternative store is being used, so action can be taken.
if (!$this->altcachestorenotice) {
echo PHP_EOL . "++ WARNING: " . 'Failed to use "' . $details['plugin'] . '" cache store, alt "' .
$details['alt']['plugin'] . '" cache store is used.' . PHP_EOL . PHP_EOL;
$this->altcachestorenotice = true;
}
$details = $details['alt'];
$details['class'] = 'cachestore_'.$details['plugin'];
$name = $details['name'];
}