srag/devtools

This package is abandoned and no longer maintained. No replacement package was suggested.

Add some dev tools to ILIAS plugin config, if core dev mode is enabled, like reload ctrl structure

1.4.0 2022-07-18 08:24 UTC

This package is auto-updated.

Last update: 2022-07-18 08:33:12 UTC


README

Add some dev tools to ILIAS plugin config, if core dev mode is enabled, like reload ctrl structure

This project is licensed under the GPL-3.0-only license

Usage

Composer

First add the following to your composer.json file:

"require": {
  "srag/devtools": ">=1.0.0"
},

And run a composer install.

If you deliver your plugin, the plugin has it's own copy of this library and the user doesn't need to install the library.

Tip: Because of multiple autoloaders of plugins, it could be, that different versions of this library exists and suddenly your plugin use an older or a newer version of an other plugin!

So I recommand to use srag/librariesnamespacechanger in your plugin.

DevToolsCtrl

Add to your plugin class

...
use srag\DevTools\x\DevToolsCtrl;
...
    /**
     * @inheritDoc
     */
    public function updateLanguages(/*?array*/ $a_lang_keys = null) : void
    {
        parent::updateLanguages($a_lang_keys);
        ...
        DevToolsCtrl::installLanguages(self::plugin());
    }
...

Add to your plugin config class

...
use srag\DevTools\x\DevToolsCtrl;
...
/**
 * ...
 * @ilCtrl_isCalledBy srag\DevTools\x\DevToolsCtrl: ilXConfigGUI
 */
class ...
...
    /**
     * @inheritDoc
     */
    public function performCommand(/*string*/ $cmd) : void
    {
        ...
        switch (strtolower($next_class)) {
            ...
            case strtolower(DevToolsCtrl::class):
                self::dic()->ctrl()->forwardCommand(new DevToolsCtrl($this, self::plugin()));
                break;
            ...
        }
        ...
    }
...
    /**
     *
     */
    protected function setTabs() : void
    {
        ...
        DevToolsCtrl::addTabs(self::plugin());
        ...
    }
...

Requirements

  • ILIAS 6.0 - 7.999
  • PHP >=7.2