ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSecurePathDefinitionProcessor Class Reference

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

+ Inheritance diagram for ilSecurePathDefinitionProcessor:
+ Collaboration diagram for ilSecurePathDefinitionProcessor:

Public Member Functions

 __construct (\ilDBInterface $db)
 
 purge ()
 This methods is supposed to purge existing data in the provider of the component, so new components can be added to a clean slate. More...
 
 beginComponent (string $component, string $type)
 This method is called when parsing of component.xml for the given component starts. More...
 
 endComponent (string $component, string $type)
 This method is called when parsing of component.xml for the given component ends. More...
 
 beginTag (string $name, array $attributes)
 This is called when a tag starts in the context of the given component. More...
 
 endTag (string $name)
 This is called when a tag ends in the context of the given component. More...
 

Protected Attributes

ilDBInterface $db
 
string $component = null
 

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

Definition at line 21 of file class.ilSecurePathDefinitionProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

ilSecurePathDefinitionProcessor::__construct ( \ilDBInterface  $db)

Definition at line 26 of file class.ilSecurePathDefinitionProcessor.php.

References $db.

27  {
28  $this->db = $db;
29  }

Member Function Documentation

◆ beginComponent()

ilSecurePathDefinitionProcessor::beginComponent ( string  $component,
string  $type 
)

This method is called when parsing of component.xml for the given component starts.

This is supposed to reset any internal parsing state.

Implements ilComponentDefinitionProcessor.

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

References $component.

35  : void
36  {
37  $this->component = $type . "/" . $component;
38  }
$type

◆ beginTag()

ilSecurePathDefinitionProcessor::beginTag ( string  $name,
array  $attributes 
)

This is called when a tag starts in the context of the given component.

Parameters
string[]$attributes

Implements ilComponentDefinitionProcessor.

Definition at line 44 of file class.ilSecurePathDefinitionProcessor.php.

References Vendor\Package\$e, and ActiveRecord\findOrFail().

44  : void
45  {
46  if ($name !== "secure_path") {
47  return;
48  }
49 
50  try {
51  $ilWACSecurePath = ilWACSecurePath::findOrFail($attributes["path"]);
52  } catch (arException $e) {
53  $ilWACSecurePath = new ilWACSecurePath();
54  $ilWACSecurePath->setPath($attributes["path"]);
55  $ilWACSecurePath->create();
56  }
57  $ilWACSecurePath->setCheckingClass($attributes["checking-class"]);
58  $ilWACSecurePath->setInSecFolder((bool) ($attributes["in-sec-folder"] ?? null));
59  $ilWACSecurePath->setComponentDirectory(realpath(__DIR__ . "/../../../../" . $this->component));
60  $ilWACSecurePath->update();
61  }
$attributes
Definition: metadata.php:248
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($format !==null) $name
Definition: metadata.php:247
static findOrFail($primary_key, array $add_constructor_args=array())
Tries to find the object and throws an Exception if object is not found, instead of returning null...
Class arException.
+ Here is the call graph for this function:

◆ endComponent()

ilSecurePathDefinitionProcessor::endComponent ( string  $component,
string  $type 
)

This method is called when parsing of component.xml for the given component ends.

Implements ilComponentDefinitionProcessor.

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

40  : void
41  {
42  }

◆ endTag()

ilSecurePathDefinitionProcessor::endTag ( string  $name)

This is called when a tag ends in the context of the given component.

Implements ilComponentDefinitionProcessor.

Definition at line 63 of file class.ilSecurePathDefinitionProcessor.php.

63  : void
64  {
65  }

◆ purge()

ilSecurePathDefinitionProcessor::purge ( )

This methods is supposed to purge existing data in the provider of the component, so new components can be added to a clean slate.

Implements ilComponentDefinitionProcessor.

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

31  : void
32  {
33  }

Field Documentation

◆ $component

string ilSecurePathDefinitionProcessor::$component = null
protected

Definition at line 24 of file class.ilSecurePathDefinitionProcessor.php.

Referenced by beginComponent().

◆ $db

ilDBInterface ilSecurePathDefinitionProcessor::$db
protected

Definition at line 23 of file class.ilSecurePathDefinitionProcessor.php.

Referenced by __construct().


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