ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 32 of file class.ilPluginAdmin.php.

Constructor & Destructor Documentation

◆ __construct()

ilPluginAdmin::__construct ( ilComponentRepository  $component_repository)

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

References $component_repository.

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

Member Function Documentation

◆ getPluginInfo()

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

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

Referenced by isActive().

42  {
43  return $this->component_repository
44  ->getComponentByTypeAndName(
45  $a_ctype,
46  $a_cname
47  )
48  ->getPluginSlotById(
49  $a_slot_id
50  )
51  ->getPluginByName(
52  $a_pname
53  );
54  }
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 77 of file class.ilPluginAdmin.php.

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

77  : bool
78  {
79  trigger_error("DEPRECATED: ilPluginAdmin::isActive is deprecated. Remove your usages of the method.");
80  try {
81  return $this->getPluginInfo($a_ctype, $a_cname, $a_slot_id, $a_pname)->isActive();
82  } catch (\InvalidArgumentException $e) {
83  return false;
84  }
85  }
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 34 of file class.ilPluginAdmin.php.

Referenced by __construct().


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