ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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. More...
 

Static Public Member Functions

static _getInstance ()
 Get instance. More...
 

Private Member Functions

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

Private Attributes

 $open_robots = false
 
 $settings = null
 

Static Private Attributes

static $instance = null
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilRobotSettings::__construct ( )
private

Private constructor => use getInstance.

@access private

Parameters

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

46 {
47 global $DIC;
48
49 $ilSetting = $DIC['ilSetting'];
50
51 $this->settings = $ilSetting;
52 $this->read();
53 }
read()
Read settings.
global $ilSetting
Definition: privfeed.php:17
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2

References $DIC, $ilSetting, read(), and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static ilRobotSettings::_getInstance ( )
static

Get instance.

@access public

Parameters

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

64 {
65 if (isset(self::$instance) and self::$instance) {
66 return self::$instance;
67 } else {
68 return self::$instance = new ilRobotSettings();
69 }
70 }

References $instance.

Referenced by ilLink\_getStaticLink().

+ Here is the caller graph for this function:

◆ checkRewrite()

ilRobotSettings::checkRewrite ( )

Indirect Check of allow override.

@access public

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

102 {
103 if (!function_exists('apache_lookup_uri')) {
104 return true;
105 }
106
107 $url = ILIAS_HTTP_PATH . '/goto_' . CLIENT_ID . '_root_1.html';
108 $status_info = @apache_lookup_uri($url);
109
110 // fallback for php as cgi (and available remote fopen)
111 if ($status_info === false && ini_get('allow_url_fopen')) {
112 // fopen respects HTTP error codes
113 $fp = @fopen($url, 'r');
114 if ($fp) {
115 fclose($fp);
116 return true;
117 }
118 return false;
119 }
120
121 return $status_info->status == 200;
122 }
$url

References $url.

◆ read()

ilRobotSettings::read ( )
private

Read settings.

@access private

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

90 {
91 $this->open_robots = (bool) $this->settings->get('open_google', false);
92 }

References 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.

@access public

Returns
bool support given

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

79 {
80 return (bool) $this->open_robots;
81 }

References $open_robots.

Field Documentation

◆ $instance

ilRobotSettings::$instance = null
staticprivate

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

Referenced by _getInstance().

◆ $open_robots

ilRobotSettings::$open_robots = false
private

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

Referenced by robotSupportEnabled().

◆ $settings

ilRobotSettings::$settings = null
private

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


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