ILIAS  trunk Revision v11.0_alpha-1811-gd2d5443e411
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilPluginAdmin Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilPluginAdmin:

Public Member Functions

 __construct (ilComponentRepository $component_repository)
 
 isActive ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 Checks whether plugin is active (include version checks) More...
 

Protected Member Functions

 getPluginInfo ($a_ctype, $a_cname, $a_slot_id, $a_pname)
 

Protected Attributes

ilComponentRepository $component_repository
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Administration class for plugins. Handles basic data from plugin.php files.

Deprecated:
Please use ilComponentRepository or ilComponentFactory instead.

This class currently needs refactoring. There are a lot of methods which are related to some specific slots.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 31 of file class.ilPluginAdmin.php.

Constructor & Destructor Documentation

◆ __construct()

ilPluginAdmin::__construct ( ilComponentRepository  $component_repository)

Definition at line 35 of file class.ilPluginAdmin.php.

References $component_repository.

36  {
37  $this->component_repository = $component_repository;
38  }
ilComponentRepository $component_repository

Member Function Documentation

◆ getPluginInfo()

ilPluginAdmin::getPluginInfo (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)
protected

Definition at line 40 of file class.ilPluginAdmin.php.

Referenced by isActive().

41  {
42  return $this->component_repository
43  ->getComponentByTypeAndName(
44  $a_ctype,
45  $a_cname
46  )
47  ->getPluginSlotById(
48  $a_slot_id
49  )
50  ->getPluginByName(
51  $a_pname
52  );
53  }
Simple value class for information about a plugin.
+ Here is the caller graph for this function:

◆ isActive()

ilPluginAdmin::isActive (   $a_ctype,
  $a_cname,
  $a_slot_id,
  $a_pname 
)

Checks whether plugin is active (include version checks)

ATTENTION: If one tries to remove this, the task doesn't look very hard initially. grep -r "isActive([^)]*,.*)" Modules/ (or in Services) only reveals a handful of locations that actually use this function. But: If you attempt to remove these locations, you run into a dependency hell in the T&A. The T&A uses dependency injection, but not container. If you add ilComponentRepository as dependency, you need to inject it ("courier anti pattern") in the classes above. This is super cumbersome and I started to loose track soon. This should be removed, but currently my concentration is not enough to do so.

Deprecated:
Parameters
string$a_ctypeComponent Type
string$a_cnameComponent Name
string$a_slot_idSlot ID
string$a_pnamePlugin Name
Returns
bool

Definition at line 76 of file class.ilPluginAdmin.php.

References Vendor\Package\$e, and getPluginInfo().

76  : bool
77  {
78  trigger_error("DEPRECATED: ilPluginAdmin::isActive is deprecated. Remove your usages of the method.");
79  try {
80  return $this->getPluginInfo($a_ctype, $a_cname, $a_slot_id, $a_pname)->isActive();
81  } catch (\InvalidArgumentException $e) {
82  return false;
83  }
84  }
getPluginInfo($a_ctype, $a_cname, $a_slot_id, $a_pname)
+ Here is the call graph for this function:

Field Documentation

◆ $component_repository

ilComponentRepository ilPluginAdmin::$component_repository
protected

Definition at line 33 of file class.ilPluginAdmin.php.

Referenced by __construct().


The documentation for this class was generated from the following file: