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.

private

Parameters

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

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

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

Member Function Documentation

◆ _getInstance()

static ilRobotSettings::_getInstance ( )
static

Get instance.

public

Parameters

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

Referenced by ilLink\_getStaticLink(), and ilObjSystemFolderGUI\showBasicSettingsObject().

64  {
65  if (isset(self::$instance) and self::$instance) {
66  return self::$instance;
67  } else {
68  return self::$instance = new ilRobotSettings();
69  }
70  }
+ Here is the caller graph for this function:

◆ checkRewrite()

ilRobotSettings::checkRewrite ( )

Indirect Check of allow override.

public

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

References $url.

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

◆ read()

ilRobotSettings::read ( )
private

Read settings.

private

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

References settings().

Referenced by __construct().

90  {
91  $this->open_robots = (bool) $this->settings->get('open_google', false);
92  }
settings()
Definition: settings.php:2
+ 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.

public

Returns
bool support given

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

References $open_robots.

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

Field Documentation

◆ $instance

ilRobotSettings::$instance = null
staticprivate

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

◆ $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: