ClearFoundation

ClearOS API

Class Hostname

Description

Hostname class.

Located in /api/Hostname.class.php (line 84)

Engine
   |
   --Hostname
Direct descendents
Class Description
HostnameChecker Hostname checker class.
Class Constant Summary
 CMD_HOSTNAME = "/bin/hostname"
 FILE_CONFIG = "/etc/sysconfig/network"
Method Summary
Hostname __construct ()
void __destruct ()
string Get ()
string GetActual ()
string GetDomain ()
boolean IsLookupable ()
void Set (string $hostname)
Variables

Inherited Variables

Inherited from Engine

Engine::$errors
Methods
Constructor __construct (line 97)

Locale constructor.

Hostname __construct ()

Redefinition of:
Engine::__construct()
Engine constructor.

Redefined in descendants as:
Destructor __destruct (line 282)
  • access: public
void __destruct ()

Redefinition of:
Engine::__destruct()
Get (line 145)

Returns host name for configuration file.

  • return: host name
  • throws: HostnameException
  • access: public
string Get ()
GetActual (line 114)

Returns host name from the gethostname system call.

  • return: host name
  • throws: HostnameException
  • access: public
string GetActual ()
GetDomain (line 176)

Returns configured domain name.

If hostname is two parts or less (eg example.com or example), we just return the hostname. If hostname has more than two parts (eg www.example.com or www.eastcoast.example.com) it strips the first part.

  • return: domain name
  • throws: HostnameException
  • access: public
string GetDomain ()
IsLookupable (line 198)

Returns true of hostname can resolve.

  • return: true if look host can resolve itself
  • access: public
boolean IsLookupable ()
Set (line 224)

Sets host name.

Hostname must have at least one period.

  • throws: HostnameException, ValidationException
  • access: public
void Set (string $hostname)
  • string $hostname: host name

Inherited Methods

Inherited From Engine

Engine::__construct()
Engine::AddValidationError()
Engine::CheckValidationErrors()
Engine::CopyValidationErrors()
Engine::GetValidationErrors()
Engine::Log()
Engine::__destruct()
Class Constants
CMD_HOSTNAME = "/bin/hostname" (line 87)
FILE_CONFIG = "/etc/sysconfig/network" (line 86)

Inherited Constants

Inherited from Engine

Engine::COMMAND_API

Documentation generated on Fri, 28 Aug 2009 20:32:11 -0400 by phpDocumentor 1.3.2