ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilRobotSettings Class Reference
+ 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

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

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

Constructor & Destructor Documentation

◆ __construct()

ilRobotSettings::__construct ( )
private

Private constructor => use getInstance.

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

34 {
35 global $DIC;
36
37 $this->settings = $DIC->settings();
38 $this->read();
39 }
read()
Read settings @access private.
global $DIC
Definition: shib_login.php:26

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 73 of file class.ilRobotSettings.php.

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

References $url, and CLIENT_ID.

◆ getInstance()

static ilRobotSettings::getInstance ( )
static

get singleton instance

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

45 {
46 if (!self::$instance instanceof ilRobotSettings) {
47 self::$instance = new self();
48 }
49 return self::$instance;
50 }

References $instance.

Referenced by ILIAS\StaticURL\Init\init().

+ Here is the caller graph for this function:

◆ read()

ilRobotSettings::read ( )
private

Read settings @access private.

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

64 : void
65 {
66 $this->open_robots = (bool) $this->settings->get('open_google', null);
67 }

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 55 of file class.ilRobotSettings.php.

55 : bool
56 {
57 return $this->open_robots;
58 }

References $open_robots.

Field Documentation

◆ $instance

self ilRobotSettings::$instance = null
staticprivate

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

Referenced by getInstance().

◆ $open_robots

bool ilRobotSettings::$open_robots = false
private

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

Referenced by robotSupportEnabled().

◆ $settings

ilSetting ilRobotSettings::$settings
private

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


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