ILIAS  release_8 Revision v8.24
ilRobotSettings 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 ilRobotSettings:

Public Member Functions

 robotSupportEnabled ()
 Check if client is open for robots. More...
 
 checkRewrite ()
 Indirect Check of allow override @access public. More...
 

Static Public Member Functions

static getInstance ()
 get singleton instance More...
 

Private Member Functions

 __construct ()
 Private constructor => use getInstance. More...
 
 read ()
 Read settings @access private. More...
 

Private Attributes

bool $open_robots = false
 
ilSetting $settings
 

Static Private Attributes

static self $instance = 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

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

ilRobotSettings::__construct ( )
private

Private constructor => use getInstance.

Definition at line 30 of file class.ilRobotSettings.php.

31 {
32 global $DIC;
33
34 $this->settings = $DIC->settings();
35 $this->read();
36 }
read()
Read settings @access private.
global $DIC
Definition: feed.php:28

References $DIC, read(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkRewrite()

ilRobotSettings::checkRewrite ( )

Indirect Check of allow override @access public.

Definition at line 70 of file class.ilRobotSettings.php.

70 : bool
71 {
72 if (!function_exists('apache_lookup_uri')) {
73 return true;
74 }
75
76 $url = ILIAS_HTTP_PATH . '/goto_' . CLIENT_ID . '_root_1.html';
77 $status_info = @apache_lookup_uri($url);
78
79 // fallback for php as cgi (and available remote fopen)
80 if ($status_info === false && ini_get('allow_url_fopen')) {
81 // fopen respects HTTP error codes
82 $fp = @fopen($url, 'r');
83 if ($fp) {
84 fclose($fp);
85 return true;
86 }
87 return false;
88 }
89
90 return $status_info->status == 200;
91 }
const CLIENT_ID
Definition: constants.php:41
$url

References $url, and CLIENT_ID.

◆ getInstance()

static ilRobotSettings::getInstance ( )
static

get singleton instance

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

42 {
43 if (!self::$instance instanceof ilRobotSettings) {
44 self::$instance = new self();
45 }
46 return self::$instance;
47 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $instance.

◆ read()

ilRobotSettings::read ( )
private

Read settings @access private.

Definition at line 61 of file class.ilRobotSettings.php.

61 : void
62 {
63 $this->open_robots = (bool) $this->settings->get('open_google', null);
64 }

References ILIAS\Repository\settings().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ robotSupportEnabled()

ilRobotSettings::robotSupportEnabled ( )

Check if client is open for robots.

Definition at line 52 of file class.ilRobotSettings.php.

52 : bool
53 {
54 return $this->open_robots;
55 }

References $open_robots.

Field Documentation

◆ $instance

self ilRobotSettings::$instance = null
staticprivate

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

Referenced by getInstance().

◆ $open_robots

bool ilRobotSettings::$open_robots = false
private

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

Referenced by robotSupportEnabled().

◆ $settings

ilSetting ilRobotSettings::$settings
private

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


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