ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
trait.ilCtrlNamespaceEncoding.php File Reference

Go to the source code of this file.

Functions

 encodeNamespaceForUrl (string $psr4_namespace)
 
 decodeNamespaceFromUrl (string $ilctrl_namespace)
 

Variables

trait ilCtrlNamespaceEncoding
 This absolute monstrosity of an encoding/decoding trait exists because ILIAS strips \ from request URLs. More...
 
static string $ilctrl_namespace_delimiter = '.'
 

Function Documentation

◆ decodeNamespaceFromUrl()

decodeNamespaceFromUrl ( string  $ilctrl_namespace)

Definition at line 42 of file trait.ilCtrlNamespaceEncoding.php.

42 : string
43 {
44 return str_replace(self::$ilctrl_namespace_delimiter, self::$psr4_namespace_delimiter, $ilctrl_namespace);
45 }
static string $ilctrl_namespace_delimiter

References $ilctrl_namespace_delimiter.

Referenced by ilCtrlContext\adoptRequestParameters().

+ Here is the caller graph for this function:

◆ encodeNamespaceForUrl()

encodeNamespaceForUrl ( string  $psr4_namespace)

Definition at line 37 of file trait.ilCtrlNamespaceEncoding.php.

37 : string
38 {
39 return str_replace(self::$psr4_namespace_delimiter, self::$ilctrl_namespace_delimiter, $psr4_namespace);
40 }

References $ilctrl_namespace_delimiter.

Variable Documentation

◆ $ilctrl_namespace_delimiter

string $ilctrl_namespace_delimiter = '.'
staticprivate

◆ ilCtrlNamespaceEncoding

trait ilCtrlNamespaceEncoding
Initial value:
{
private static string $psr4_namespace_delimiter = '\\'

This absolute monstrosity of an encoding/decoding trait exists because ILIAS strips \ from request URLs.

This prevents ilCtrl from using PSR-4 namespaced command- and base-classes until we either work around this issue or drop these as arguments from the URL – which we could, but decide not to pursue, because we should focus on migrating towards a real routing component (see https://docu.ilias.de/go/wiki/wpage_8780_1357).

Author
Thibeau Fuhrer thibe.nosp@m.au@s.nosp@m.r.sol.nosp@m.utio.nosp@m.ns

@noinspection AutoloadingIssuesInspection

Definition at line 32 of file trait.ilCtrlNamespaceEncoding.php.