public function requires($addon = 'atk', $v, $location = null)
{
$cv = $this->getVersion($addon);
if (version_compare($cv, $v) < 0) {
if ($addon == 'atk') {
$e = $this->exception('Agile Toolkit version is too old');
} else {
$e = $this->exception('Add-on is outdated')->addMoreInfo('addon', $addon);
}
$e->addMoreInfo('required', $v)->addMoreInfo('you have', $cv);
if ($location !== null) {
$e->addMoreInfo('download_location', $location);
}
throw $e;
}
// Possibly we need to enable compatibility version
if ($addon == 'atk') {
if (version_compare($v, '4.2') < 0 && version_compare($v, '4.1.4') >= 0) {
$this->add('Controller_Compat');
return true;
}
}
return true;
}