Support Joomla!

references:joomla.framework:application:japplicationhelper-getclientinfo

Table of Contents

getClientInfo

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JApplicationHelper Method getClientInfo Reference getClientInfo() Never Work in Progress

Gets information on a specific Joomla! client application. A client is either the site, the adminstrator, or installation. Currently these are generally in static locations in reference to each other. There are plans for future versions such that these can be moved independently of each other. This method will be of greater use in these future versions.

The client can be referenced either by an id, such as the id returned by the JApplication::getClientId method, or by name, such as ‘site’, ‘administrator’, or ‘installation’. If no arguments are provided, the method returns an array describing all known clients.

Syntax

mixed getClientInfo ( $id = null, $byName = false)

$id mixed If NULL (default) returns all clients, an integer (0, 1, 2), or a string (’site’, ‘administrator’, ‘installation’) identifying the client
$byName bool Optional, defaults to FALSE. Must be TRUE if $id is a string identifying the client.

Examples

Invoking the getClientInfo method as follows:

Example 1: client id

jimport( 'joomla.application.helper' );

$client = JApplicationHelper::getClientInfo( 1 );
print_r( $client );

might output

Result 1

stdClass Object
(
  [id] => 1
  [name] => administrator
  [path] => C:\Apache\htdocs\joomla\administrator
)

Example 2: client name

jimport( 'joomla.application.helper' );

$client = JApplicationHelper::getClientInfo( 'site', false );
print_r( $client );

might output

Result 1

stdClass Object
(
  [id] => 0
  [name] => site
  [path] => C:\Apache\htdocs\joomla
)

Example 2: all clients

jimport( 'joomla.application.helper' );

$client = JApplicationHelper::getClientInfo( );
print_r( $client );

might output

Result 1

Array
(
  [0] => stdClass Object
    (
     [id] => 0
     [name] => site
     [path] => C:\Apache\htdocs\joomla
    )
  [1] => stdClass Object
    (
     [id] => 1
     [name] => administrator
     [path] => C:\Apache\htdocs\joomla\administrator
    )
  [2] => stdClass Object
    (
     [id] => 2
     [name] => installation
     [path] => C:\Apache\htdocs\joomla\installation
    )
)

 
references/joomla.framework/application/japplicationhelper-getclientinfo.txt (1187 views) · Last modified: 2007/09/22 02:46