ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilProxySettings Class Reference

class ilProxySettings More...

+ Collaboration diagram for ilProxySettings:

Public Member Functions

 isActive ($status=null)
 Getter/Setter for status. More...
 
 setHost ($host)
 Setter for host. More...
 
 getHost ()
 Getter for host. More...
 
 setPort ($port)
 Setter for port. More...
 
 getPort ()
 Getter for port. More...
 
 save ()
 Saves the current data in database. More...
 
 checkConnection ()
 Verifies the proxy server connection. More...
 

Static Public Member Functions

static _getInstance ()
 Getter for unique instance. More...
 

Protected Member Functions

 __construct ()
 Constructor. More...
 
 read ()
 Fetches data from database. More...
 

Protected Attributes

 $host = ''
 
 $post = ''
 
 $isActive = false
 

Static Protected Attributes

static $_instance = null
 

Private Member Functions

 __clone ()
 __clone More...
 

Detailed Description

class ilProxySettings

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 13 of file class.ilProxySettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilProxySettings::__construct ( )
protected

Constructor.

protected

Definition at line 66 of file class.ilProxySettings.php.

References read().

67  {
68  $this->read();
69  }
read()
Fetches data from database.
+ Here is the call graph for this function:

Member Function Documentation

◆ __clone()

ilProxySettings::__clone ( )
private

__clone

private

Definition at line 78 of file class.ilProxySettings.php.

79  {
80  }

◆ _getInstance()

static ilProxySettings::_getInstance ( )
static

Getter for unique instance.

public

Returns
ilProxySettings

Definition at line 91 of file class.ilProxySettings.php.

Referenced by ilLinkChecker\__validateLinks(), ilExternalFeed\_checkUrl(), ilExternalFeed\_determineFeedUrl(), ilExternalFeed\ilExternalFeed(), ilObjSystemFolderGUI\printProxyStatus(), ilObjSystemFolderGUI\saveProxyObject(), and ilObjSystemFolderGUI\showProxyObject().

92  {
93  if(null === self::$_instance)
94  {
95  self::$_instance = new self();
96  }
97 
98  return self::$_instance;
99  }
+ Here is the caller graph for this function:

◆ checkConnection()

ilProxySettings::checkConnection ( )

Verifies the proxy server connection.

public

Returns
ilProxySettings
Exceptions
ilProxyException

Definition at line 224 of file class.ilProxySettings.php.

References $lng, getHost(), getPort(), and PEAR_ERROR_RETURN.

225  {
226  require_once 'Services/PEAR/lib/Net/Socket.php';
227 
228  $socket = new Net_Socket();
229  $socket->setErrorHandling(PEAR_ERROR_RETURN);
230  $response = $socket->connect($this->getHost(), $this->getPort());
231  if(!is_bool($response))
232  {
233  global $lng;
234  throw new ilProxyException(strlen($response) ? $response : $lng->txt('proxy_not_connectable'));
235  }
236 
237  return $this;
238  }
getHost()
Getter for host.
Class for proxy related exception handling in ILIAS.
getPort()
Getter for port.
const PEAR_ERROR_RETURN
#+ ERROR constants
Definition: PEAR.php:31
global $lng
Definition: privfeed.php:40
Generalized Socket class.
Definition: Socket.php:35
+ Here is the call graph for this function:

◆ getHost()

ilProxySettings::getHost ( )

Getter for host.

public

Returns
string

Definition at line 162 of file class.ilProxySettings.php.

References $host.

Referenced by checkConnection(), and save().

163  {
164  return $this->host;
165  }
+ Here is the caller graph for this function:

◆ getPort()

ilProxySettings::getPort ( )

Getter for port.

public

Returns
string

Definition at line 191 of file class.ilProxySettings.php.

Referenced by checkConnection(), and save().

192  {
193  return $this->port;
194  }
+ Here is the caller graph for this function:

◆ isActive()

ilProxySettings::isActive (   $status = null)

Getter/Setter for status.

public

Parameters
mixedboolean or null
Returns
mixed ilProxySettings or boolean

Definition at line 126 of file class.ilProxySettings.php.

References $isActive.

Referenced by read(), and save().

127  {
128  if(null === $status)
129  {
130  return (bool)$this->isActive;
131  }
132 
133  $this->isActive = (bool)$status;
134 
135  return $this;
136  }
isActive($status=null)
Getter/Setter for status.
+ Here is the caller graph for this function:

◆ read()

ilProxySettings::read ( )
protected

Fetches data from database.

protected

Definition at line 108 of file class.ilProxySettings.php.

References $ilSetting, isActive(), setHost(), and setPort().

Referenced by __construct().

109  {
110  global $ilSetting;
111 
112  $this->setHost($ilSetting->get('proxy_host'));
113  $this->setPort($ilSetting->get('proxy_port'));
114  $this->isActive((bool)$ilSetting->get('proxy_status'));
115  }
isActive($status=null)
Getter/Setter for status.
setPort($port)
Setter for port.
global $ilSetting
Definition: privfeed.php:40
setHost($host)
Setter for host.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilProxySettings::save ( )

Saves the current data in database.

public

Returns
ilProxySettings

Definition at line 204 of file class.ilProxySettings.php.

References $ilSetting, getHost(), getPort(), and isActive().

205  {
206  global $ilSetting;
207 
208  $ilSetting->set('proxy_host', $this->getHost());
209  $ilSetting->set('proxy_port', $this->getPort());
210  $ilSetting->set('proxy_status', (int)$this->isActive());
211 
212  return $this;
213  }
getHost()
Getter for host.
isActive($status=null)
Getter/Setter for status.
getPort()
Getter for port.
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ setHost()

ilProxySettings::setHost (   $host)

Setter for host.

public

Parameters
string
Returns
ilProxySettings

Definition at line 147 of file class.ilProxySettings.php.

References $host.

Referenced by read().

148  {
149  $this->host = $host;
150 
151  return $this;
152  }
+ Here is the caller graph for this function:

◆ setPort()

ilProxySettings::setPort (   $port)

Setter for port.

public

Parameters
string
Returns
ilProxySettings

Definition at line 176 of file class.ilProxySettings.php.

Referenced by read().

177  {
178  $this->port = $port;
179 
180  return $this;
181  }
+ Here is the caller graph for this function:

Field Documentation

◆ $_instance

ilProxySettings::$_instance = null
staticprotected

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

◆ $host

ilProxySettings::$host = ''
protected

Definition at line 35 of file class.ilProxySettings.php.

Referenced by getHost(), and setHost().

◆ $isActive

ilProxySettings::$isActive = false
protected

Definition at line 57 of file class.ilProxySettings.php.

Referenced by isActive().

◆ $post

ilProxySettings::$post = ''
protected

Definition at line 46 of file class.ilProxySettings.php.


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