references:joomla.framework:application:japplicationhelper-getclientinfoTable of Contents
getClientInfo
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. Syntaxmixed getClientInfo ( $id = null, $byName = false)
ExamplesInvoking 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 ) ) |


