ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
65  return self::$instance;
66  }
67  else
68  {
69  return self::$instance = new ilRobotSettings();
70  }
71  }
+ Here is the caller graph for this function:

◆ checkRewrite()

ilRobotSettings::checkRewrite ( )

Indirect Check of allow override.

public

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

References $url.

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

◆ read()

ilRobotSettings::read ( )
private

Read settings.

private

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

References settings().

Referenced by __construct().

91  {
92  $this->open_robots = (bool) $this->settings->get('open_google',false);
93  }
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 79 of file class.ilRobotSettings.php.

References $open_robots.

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

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: