Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00032 class ilRobotSettings
00033 {
00034 private $open_robots = false;
00035 private $settings = null;
00036
00037 private static $instance = null;
00045 private function __construct()
00046 {
00047 global $ilSetting;
00048
00049 $this->settings = $ilSetting;
00050 $this->read();
00051 }
00052
00061 public static function _getInstance()
00062 {
00063 if(isset(self::$instance) and self::$instance)
00064 {
00065 return self::$instance;
00066 }
00067 else
00068 {
00069 return self::$instance = new ilRobotSettings();
00070 }
00071 }
00072
00079 public function robotSupportEnabled()
00080 {
00081 return (bool) $this->open_robots;
00082 }
00083
00090 private function read()
00091 {
00092 $this->open_robots = (bool) $this->settings->get('open_google',false);
00093 if(!$this->checkModRewrite())
00094 {
00095 $this->open_robots = false;
00096 }
00097 }
00098
00106 public function checkModRewrite()
00107 {
00108 if (function_exists("apache_get_modules"))
00109 {
00110 if(in_array('mod_rewrite',apache_get_modules()))
00111 {
00112 return true;
00113 }
00114 }
00115 return false;
00116 }
00117
00124 public function checkRewrite()
00125 {
00126 if(!function_exists('apache_lookup_uri'))
00127 {
00128 return true;
00129 }
00130 $status_info = @apache_lookup_uri(ILIAS_HTTP_PATH.'/goto_'.CLIENT_ID.'_root_1.html');
00131 return $status_info->status == 200;
00132 }
00133 }
00134
00135
00136 ?>