[ Index ]
 

Code source de Typo3 4.1.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/t3lib/ -> class.t3lib_exec.php (sommaire)

t3lib_exec finds executables (programs) on Unix and Windows without knowing where they are $Id: class.t3lib_exec.php 1421 2006-04-10 09:27:15Z mundaun $

Author: René Fritz <r.fritz@colorcube.de>
Poids: 408 lignes (11 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

t3lib_exec:: (9 méthodes):
  checkCommand()
  getCommand()
  addPaths()
  getPaths()
  _init()
  _initPaths()
  _getConfiguredApps()
  _getPaths()
  _fixPath()


Classe: t3lib_exec  - X-Ref

returns exec command for a program
or false

This class is meant to be used without instance:
$cmd = t3lib_exec::getCommand ('awstats','perl');

The data of this class is hold in a global variable. Doing it this way the setup is cached.
That means if a program is found once it don't have to be searched again.

user functions:

addPaths() could be used to extend the search paths
getCommand() get a command string
checkCommand() returns true if a command is available

Search paths that are included:
$TYPO3_CONF_VARS['GFX']['im_path_lzw'] or $TYPO3_CONF_VARS['GFX']['im_path']
$TYPO3_CONF_VARS['SYS']['binPath']
$GLOBALS['_SERVER']['PATH']
'/usr/bin/,/usr/local/bin/' on Unix

binaries can be preconfigured with
$TYPO3_CONF_VARS['SYS']['binSetup']

checkCommand($cmd, $handler='')   X-Ref
Checks if a command is valid or not
updates global vars

param: string        the command that should be executed. eg: "convert"
param: string        executer for the command. eg: "perl"
return: boolean        false if cmd is not found, or -1 if the handler is not found

getCommand($cmd, $handler='', $handlerOpt='')   X-Ref
Returns a command string for exec(), system()

param: string        the command that should be executed. eg: "convert"
param: string        handler (executor) for the command. eg: "perl"
param: string        options for the handler, like '-w' for "perl"
return: mixed        returns command string, or false if cmd is not found, or -1 if the handler is not found

addPaths($paths)   X-Ref
Extend the preset paths. This way an extension can install an executable and provide the path to t3lib_exec.

param: string        comma seperated list of extra paths where a command should be searched. Relative paths (without leading "/") are prepend with site root path (PATH_site).
return: void

getPaths($addInvalid=false)   X-Ref
Returns an array of search paths

param: boolean        If set the array contains invalid path too. Then the key is the path and the value is empty
return: array        Array of search paths (empty if exec is disabled)

_init()   X-Ref
Initialization, internal

return: void

_initPaths($paths='')   X-Ref
Init and extend the preset paths with own

param: string        Comma seperated list of extra paths where a command should be searched. Relative paths (without leading "/") are prepend with site root path (PATH_site).
return: void

_getConfiguredApps()   X-Ref
Processes and returns the paths from $TYPO3_CONF_VARS['SYS']['binSetup']

return: array        Array of commands and path

_getPaths()   X-Ref
Set the search paths from different sources, internal

return: array        Array of absolute paths (keys and values are equal)

_fixPath($path)   X-Ref
Set a path to the right format

param: string        Input path
return: string        Output path



Généré le : Sun Nov 25 17:13:16 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics