Skip to content
Snippets Groups Projects
Select Git revision
  • 89512696839235e4b3d2ca135917ae038ff5fc3c
  • main default protected
  • 5.5 protected
  • atlantis
  • 5.3 protected
  • 5.0 protected
  • issue-23
  • issue8-seat-logging-and-export
  • ticket-216
  • tickets-215-216-241-242
10 results

StudipMemoryCache.class.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Plugin.php 1.03 KiB
    <?php
    namespace SchwarzesBrett;
    
    use NotificationCenter;
    use PageLayout;
    use StudIPPlugin;
    
    abstract class Plugin extends StudIPPlugin
    {
        use \TranslatablePluginTrait;
    
        public function __construct()
        {
            parent::__construct();
    
            foreach (get_class_methods($this) as $method) {
                if (!preg_match('/^on\w+(Did|Will)\w+$/', $method)) {
                    continue;
                }
    
                $trigger = mb_substr($method, 2);
                NotificationCenter::addObserver($this, $method, $trigger);
            }
        }
    
        public static function getTranslationDomain()
        {
            return 'schwarzes-brett';
        }
    
        public function getTranslationPath()
        {
            return $this->getPluginPath() . '/locale';
        }
    
        /**
         * Returns the plugin version from manifest.
         *
         * @return string version
         */
        public function getPluginVersion()
        {
            static $manifest = null;
            if ($manifest === null) {
                $manifest = $this->getMetadata();
            }
            return $manifest['version'];
        }
    }