TYPO3
7.6
|
Static Public Member Functions | |
static | exec ($command, &$output=null, &$returnValue=0) |
static | imageMagickCommand ($command, $parameters, $path= '') |
static | checkCommand ($cmd, $handler= '') |
static | getCommand ($cmd, $handler= '', $handlerOpt= '') |
static | addPaths ($paths) |
static | getPaths ($addInvalid=false) |
static | escapeShellArguments (array $input) |
static | escapeShellArgument ($input) |
Static Protected Member Functions | |
static | init () |
static | initPaths ($paths= '') |
static | getConfiguredApps () |
static | getPathsInternal () |
static | fixPath ($path) |
Static Protected Attributes | |
static | $initialized = false |
static | $applications = array() |
static | $paths = null |
Class to handle system commands. finds executables (programs) on Unix and Windows without knowing where they are
returns exec command for a program or FALSE
This class is meant to be used without instance: $cmd = CommandUtility::getCommand ('awstats','perl');
The data of this class 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']
Definition at line 45 of file CommandUtility.php.
|
static |
Extend the preset paths. This way an extension can install an executable and provide the path to
string | $paths | Comma separated list of extra paths where a command should be searched. Relative paths (without leading "/") are prepend with site root path (PATH_site). |
Definition at line 258 of file CommandUtility.php.
References CommandUtility\$paths.
|
static |
Checks if a command is valid or not, updates global variables
string | $cmd | The command that should be executed. eg: "convert" |
string | $handler | Executer for the command. eg: "perl" |
Definition at line 155 of file CommandUtility.php.
Referenced by ExtensionManagementUtility\isServiceAvailable().
|
static |
Escape a shell argument (for example a filename) to be used on the local system.
The setting UTF8filesystem will be taken into account.
string | $input | Input-argument to be escaped |
Definition at line 470 of file CommandUtility.php.
Referenced by GraphicalFunctions\combineExec(), GraphicalFunctions\imageMagickExec(), GraphicalFunctions\imageMagickIdentify(), and ThumbnailView\main().
|
static |
Escape shell arguments (for example filenames) to be used on the local system.
The setting UTF8filesystem will be taken into account.
string[] | $input Input arguments to be escaped |
Definition at line 445 of file CommandUtility.php.
References $GLOBALS.
Referenced by PreviewProcessing\resizeImage().
|
static |
Wrapper function for php exec function Needs to be central to have better control and possible fix for issues
string | $command | |
NULL | array | $output | |
int | $returnValue |
Definition at line 82 of file CommandUtility.php.
Referenced by CommandLineBackend\decrypt(), FileContentParser\fileContentParts(), ExtendedFileUtility\func_unzip(), SystemInformationToolbarItem\getGitRevision(), GraphicalFunctions\gifCompress(), CommandLineBackend\isAvailable(), FileContentParser\readFileContent(), GraphicalFunctions\readPngGif(), and PreviewProcessing\resizeImage().
|
staticprotected |
Set a path to the right format
string | $path | Input path |
Definition at line 432 of file CommandUtility.php.
|
static |
Returns a command string for exec(), system()
string | $cmd | The command that should be executed. eg: "convert" |
string | $handler | Handler (executor) for the command. eg: "perl" |
string | $handlerOpt | Options for the handler, like '-w' for "perl" |
Definition at line 227 of file CommandUtility.php.
Referenced by CommandLineBackend\__construct().
|
staticprotected |
Processes and returns the paths from $GLOBALS['TYPO3_CONF_VARS']['SYS']['binSetup']
Definition at line 355 of file CommandUtility.php.
References $GLOBALS, and GeneralUtility\trimExplode().
|
static |
Returns an array of search paths
bool | $addInvalid | If set the array contains invalid path too. Then the key is the path and the value is empty |
Definition at line 269 of file CommandUtility.php.
References CommandUtility\$paths.
Referenced by ServicesListReport\renderExecutablesSearchPathList().
|
staticprotected |
Sets the search paths from different sources, internal
Definition at line 381 of file CommandUtility.php.
References $GLOBALS, and GeneralUtility\trimExplode().
|
static |
Compile the command for running ImageMagick/GraphicsMagick.
string | $command | Command to be run: identify, convert or combine/composite |
string | $parameters | The parameters string |
string | $path | Override the default path (e.g. used by the install tool) |
Definition at line 96 of file CommandUtility.php.
References $GLOBALS, GeneralUtility\fixWindowsFilePath(), and GeneralUtility\unQuoteFilenames().
Referenced by GeneralUtility\imageMagickCommand().
|
staticprotected |
Initializes this class
Definition at line 292 of file CommandUtility.php.
References $GLOBALS.
|
staticprotected |
Initializes and extends the preset paths with own
string | $paths | Comma separated list of extra paths where a command should be searched. Relative paths (without leading "/") are prepend with site root path (PATH_site). |
Definition at line 311 of file CommandUtility.php.
References CommandUtility\$paths, and GeneralUtility\trimExplode().
|
staticprotected |
Definition at line 63 of file CommandUtility.php.
|
staticprotected |
Definition at line 52 of file CommandUtility.php.
|
staticprotected |
Definition at line 70 of file CommandUtility.php.
Referenced by CommandUtility\addPaths(), CommandUtility\getPaths(), and CommandUtility\initPaths().