ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilGlobalCacheSetupAgent Class Reference
+ Inheritance diagram for ilGlobalCacheSetupAgent:
+ Collaboration diagram for ilGlobalCacheSetupAgent:

Public Member Functions

 __construct (Refinery\Factory $refinery)
 
 hasConfig ()
 
 getConfigInput (Setup\Config $config=null)
 
 getArrayToConfigTransformation ()
 
 getInstallObjective (Setup\Config $config=null)
 
 getUpdateObjective (Setup\Config $config=null)
 
 getBuildArtifactObjective ()
 

Protected Attributes

 $refinery
 

Detailed Description

Definition at line 9 of file class.ilGlobalCacheSetupAgent.php.

Constructor & Destructor Documentation

◆ __construct()

ilGlobalCacheSetupAgent::__construct ( Refinery\Factory  $refinery)

Definition at line 16 of file class.ilGlobalCacheSetupAgent.php.

References $refinery.

18  {
19  $this->refinery = $refinery;
20  }

Member Function Documentation

◆ getArrayToConfigTransformation()

ilGlobalCacheSetupAgent::getArrayToConfigTransformation ( )

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

References $data, ilGlobalCache\TYPE_APC, ilGlobalCache\TYPE_MEMCACHED, ilGlobalCache\TYPE_STATIC, and ilGlobalCache\TYPE_XCACHE.

41  : Refinery\Transformation
42  {
43  return $this->refinery->custom()->transformation(function ($data) {
44  $settings = new \ilGlobalCacheSettings();
45  if ($data === null || !$data["components"] || $data["service"] == "none") {
46  $settings->setActive(false);
47  } else {
48  $settings->setActive(true);
49  switch ($data["service"]) {
50  case "static":
51  $settings->setService(\ilGlobalCache::TYPE_STATIC);
52  break;
53  case "xcache":
54  $settings->setService(\ilGlobalCache::TYPE_XCACHE);
55  break;
56  case "memcached":
57  $settings->setService(\ilGlobalCache::TYPE_MEMCACHED);
58  break;
59  case "apc":
60  $settings->setService(\ilGlobalCache::TYPE_APC);
61  break;
62  default:
63  throw new \InvalidArgumentException(
64  "Unknown caching service: '{$data["service"]}'"
65  );
66  }
67  $settings->resetActivatedComponents();
68  if ($data["components"] == "all") {
69  $settings->activateAll();
70  } else {
71  foreach ($data["components"] as $cmp) {
72  $settings->addActivatedComponents($cmp);
73  }
74  }
75  }
76  return $settings;
77  });
78  }
$data
Definition: storeScorm.php:23

◆ getBuildArtifactObjective()

ilGlobalCacheSetupAgent::getBuildArtifactObjective ( )

Definition at line 103 of file class.ilGlobalCacheSetupAgent.php.

103  : Setup\Objective
104  {
105  return new Setup\NullObjective();
106  }

◆ getConfigInput()

ilGlobalCacheSetupAgent::getConfigInput ( Setup\Config  $config = null)

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

33  : UI\Component\Input\Field\Input
34  {
35  throw new \LogicException("Not yet implemented.");
36  }

◆ getInstallObjective()

ilGlobalCacheSetupAgent::getInstallObjective ( Setup\Config  $config = null)

Definition at line 83 of file class.ilGlobalCacheSetupAgent.php.

References $config.

83  : Setup\Objective
84  {
85  return new Setup\ObjectiveCollection(
86  "Complete objectives from Services/GlobalCache",
87  false,
89  );
90  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68

◆ getUpdateObjective()

ilGlobalCacheSetupAgent::getUpdateObjective ( Setup\Config  $config = null)

Definition at line 95 of file class.ilGlobalCacheSetupAgent.php.

95  : Setup\Objective
96  {
97  return new Setup\NullObjective();
98  }

◆ hasConfig()

ilGlobalCacheSetupAgent::hasConfig ( )

Definition at line 25 of file class.ilGlobalCacheSetupAgent.php.

25  : bool
26  {
27  return true;
28  }

Field Documentation

◆ $refinery

ilGlobalCacheSetupAgent::$refinery
protected

Definition at line 14 of file class.ilGlobalCacheSetupAgent.php.

Referenced by __construct().


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