ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 public. More...
 

Static Public Member Functions

static getInstance ()
 get singleton instance More...
 

Private Member Functions

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

Private Attributes

bool $open_robots = false
 
ilSetting $settings
 

Static Private Attributes

static self $instance = null
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

ilRobotSettings::__construct ( )
private

Private constructor => use getInstance.

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

References $DIC, read(), and ILIAS\Repository\settings().

34  {
35  global $DIC;
36 
37  $this->settings = $DIC->settings();
38  $this->read();
39  }
global $DIC
Definition: shib_login.php:26
read()
Read settings private.
+ Here is the call graph for this function:

Member Function Documentation

◆ checkRewrite()

ilRobotSettings::checkRewrite ( )

Indirect Check of allow override public.

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

References $url, and CLIENT_ID.

73  : bool
74  {
75  if (!function_exists('apache_lookup_uri')) {
76  return true;
77  }
78 
79  $url = ILIAS_HTTP_PATH . '/goto_' . CLIENT_ID . '_root_1.html';
80  $status_info = @apache_lookup_uri($url);
81 
82  // fallback for php as cgi (and available remote fopen)
83  if ($status_info === false && ini_get('allow_url_fopen')) {
84  // fopen respects HTTP error codes
85  $fp = @fopen($url, 'r');
86  if ($fp) {
87  fclose($fp);
88  return true;
89  }
90  return false;
91  }
92 
93  return $status_info->status == 200;
94  }
$url
Definition: shib_logout.php:68
const CLIENT_ID
Definition: constants.php:41

◆ getInstance()

static ilRobotSettings::getInstance ( )
static

get singleton instance

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

Referenced by ILIAS\StaticURL\Init\init(), and ilObjSystemFolderGUI\showBasicSettingsObject().

45  {
46  if (!self::$instance instanceof ilRobotSettings) {
47  self::$instance = new self();
48  }
49  return self::$instance;
50  }
+ Here is the caller graph for this function:

◆ read()

ilRobotSettings::read ( )
private

Read settings private.

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

References null, and ILIAS\Repository\settings().

Referenced by __construct().

64  : void
65  {
66  $this->open_robots = (bool) $this->settings->get('open_google', null);
67  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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.

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

References $open_robots.

55  : bool
56  {
57  return $this->open_robots;
58  }

Field Documentation

◆ $instance

self ilRobotSettings::$instance = null
staticprivate

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

◆ $open_robots

bool ilRobotSettings::$open_robots = false
private

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

Referenced by robotSupportEnabled().

◆ $settings

ilSetting ilRobotSettings::$settings
private

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


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