Hooks::is_plugin_activated ( $plugin )

Checks if a particular plugin is activated

Return: (mixed)

Source file: app/src/Hooks.php

View source


Used by


Source

    public function is_plugin_activated($plugin)
    {
        try {
            $active = $this->app->db->plugin()->where('location = ?', $plugin);
            $q = $active->find(function ($data) {
                $array = [];
                foreach ($data as $d) {
                    $array[] = $d;
                }
                return $array;
            });

            if (count($q) > 0)
                return true;
            return false;
        } catch (NotFoundException $e) {
            Cascade::getLogger('error')->error(sprintf('SQLSTATE[%s]: Error: %s', $e->getCode(), $e->getMessage()));
            _etsis_flash()->error(_etsis_flash()->notice(409));
        } catch (ORMException $e) {
            Cascade::getLogger('error')->error(sprintf('SQLSTATE[%s]: Error: %s', $e->getCode(), $e->getMessage()));
            _etsis_flash()->error(_etsis_flash()->notice(409));
        } catch (Exception $e) {
            Cascade::getLogger('error')->error(sprintf('SQLSTATE[%s]: Error: %s', $e->getCode(), $e->getMessage()));
            _etsis_flash()->error(_etsis_flash()->notice(409));
        }
    }


Changelog

  • Since: eduTrac SIS 1.0.1

User Contributed Notes

You must log in before being able to contribute a note.