Module.php 508 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Lychee\Modules;
  3. abstract class Module {
  4. protected function plugins($name, $location, $args) {
  5. self::dependencies(isset($name, $location, $args));
  6. # Parse
  7. $location = ($location===0 ? 'before' : 'after');
  8. # Call plugins
  9. Plugins::get()->activate($name . ":" . $location, $args);
  10. return true;
  11. }
  12. final public static function dependencies($available = false) {
  13. if ($available===false) exit('Error: Can not execute function. Missing parameters or variables.');
  14. }
  15. }
  16. ?>