lychee/php/Modules/Module.php

29 lines
508 B
PHP
Raw Normal View History

2014-04-04 19:27:10 +00:00
<?php
namespace Lychee\Modules;
2014-04-04 19:27:10 +00:00
abstract class Module {
2014-04-04 19:27:10 +00:00
protected function plugins($name, $location, $args) {
self::dependencies(isset($name, $location, $args));
2014-04-04 19:27:10 +00:00
# Parse
$location = ($location===0 ? 'before' : 'after');
# Call plugins
Plugins::get()->activate($name . ":" . $location, $args);
2014-04-04 19:27:10 +00:00
return true;
}
final public static function dependencies($available = false) {
if ($available===false) exit('Error: Can not execute function. Missing parameters or variables.');
}
2014-04-28 08:17:26 +00:00
}
?>