ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 $ilSetting;
48
49 $this->settings = $ilSetting;
50 $this->read();
51 }
read()
Read settings.
global $ilSetting
Definition: privfeed.php:40

References $ilSetting, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static ilRobotSettings::_getInstance ( )
static

Get instance.

@access public

Parameters

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

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 }

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

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

References $url.

◆ read()

ilRobotSettings::read ( )
private

Read settings.

@access private

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

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

Referenced by __construct().

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

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

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: