ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $ilSetting, read(), and settings().

46  {
47  global $ilSetting;
48 
49  $this->settings = $ilSetting;
50  $this->read();
51  }
settings()
Definition: settings.php:2
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 61 of file class.ilRobotSettings.php.

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

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

◆ checkRewrite()

ilRobotSettings::checkRewrite ( )

Indirect Check of allow override.

public

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

References $url.

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

◆ read()

ilRobotSettings::read ( )
private

Read settings.

private

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

References settings().

Referenced by __construct().

88  {
89  $this->open_robots = (bool) $this->settings->get('open_google', false);
90  }
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 76 of file class.ilRobotSettings.php.

References $open_robots.

77  {
78  return (bool) $this->open_robots;
79  }

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: