TYPO3
7.6
|
Public Member Functions | |
getServiceInfo () | |
getServiceKey () | |
getServiceTitle () | |
getServiceOption ($optionName, $defaultValue= '', $includeDefaultConfig=true) | |
devLog ($msg, $severity=0, $dataVar=false) | |
errorPush ($errNum=T3_ERR_SV_GENERAL, $errMsg= 'Unspecified error occurred') | |
errorPull () | |
getLastError () | |
getLastErrorMsg () | |
getErrorMsgArray () | |
getLastErrorArray () | |
resetErrors () | |
checkExec ($progList) | |
deactivateService () | |
checkInputFile ($absFile) | |
readFile ($absFile, $length=0) | |
writeFile ($content, $absFile= '') | |
tempFile ($filePrefix) | |
registerTempFile ($absFile) | |
unlinkTempFiles () | |
setInput ($content, $type= '') | |
setInputFile ($absFile, $type= '') | |
getInput () | |
getInputFile ($createFile= '') | |
setOutputFile ($absFile) | |
getOutput () | |
getOutputFile ($absFile= '') | |
init () | |
reset () | |
__destruct () | |
Public Attributes | |
$info = array() | |
$error = array() | |
$writeDevLog = false | |
$out = '' | |
$inputFile = '' | |
$inputContent = '' | |
$inputType = '' | |
$outputFile = '' | |
$tempFiles = array() | |
Protected Attributes | |
$shutdownRegistry = array() | |
$prefixId = '' | |
Parent class for "Services" classes
Definition at line 20 of file AbstractService.php.
__destruct | ( | ) |
Clean up the service. Child classes should explicitly call parent::__destruct() in their destructors for this to work
Definition at line 556 of file AbstractService.php.
References AbstractService\unlinkTempFiles().
checkExec | ( | $progList | ) |
check the availability of external programs
string | $progList | Comma list of programs 'perl,python,pdftotext' |
Definition at line 261 of file AbstractService.php.
References AbstractService\errorPush().
Referenced by AbstractService\init().
checkInputFile | ( | $absFile | ) |
Check if a file exists and is readable.
string | $absFile | File name with absolute path. |
Definition at line 296 of file AbstractService.php.
References AbstractService\errorPush(), and GeneralUtility\isAllowedAbsPath().
Referenced by AbstractService\getInputFile(), and AbstractService\readFile().
deactivateService | ( | ) |
Deactivate the service. Use this if the service fails at runtime and will not be available.
Definition at line 280 of file AbstractService.php.
devLog | ( | $msg, | |
$severity = 0 , |
|||
$dataVar = false |
|||
) |
Logs debug messages to ::devLog()
string | $msg | Debug message |
int | $severity | Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message |
array | bool | $dataVar | dditional data you want to pass to the logger. |
Definition at line 151 of file AbstractService.php.
errorPull | ( | ) |
Removes the last error from the error stack.
Definition at line 178 of file AbstractService.php.
errorPush | ( | $errNum = T3_ERR_SV_GENERAL , |
|
$errMsg = 'Unspecified error occurred' |
|||
) |
Puts an error on the error stack. Calling without parameter adds a general error.
Definition at line 165 of file AbstractService.php.
References $GLOBALS.
Referenced by AbstractService\checkExec(), AbstractService\checkInputFile(), AbstractService\readFile(), AbstractService\tempFile(), and AbstractService\writeFile().
getErrorMsgArray | ( | ) |
Returns all error messages as array.
Definition at line 219 of file AbstractService.php.
References AbstractService\$error.
getInput | ( | ) |
Get the input content. Will be read from input file if needed. (That is if ->inputContent is empty and ->inputFile is not)
Definition at line 440 of file AbstractService.php.
References AbstractService\$inputContent, and AbstractService\readFile().
getInputFile | ( | $createFile = '' | ) |
Get the input file name. If the content was set by setContent a file will be created.
string | $createFile | File name. If empty a temp file will be created. |
Definition at line 455 of file AbstractService.php.
References AbstractService\$inputFile, AbstractService\checkInputFile(), elseif, and AbstractService\writeFile().
getLastError | ( | ) |
Returns the last error number from the error stack.
Definition at line 188 of file AbstractService.php.
References AbstractService\$error.
Referenced by AbstractService\init().
getLastErrorArray | ( | ) |
Returns the last array from the error stack.
Definition at line 235 of file AbstractService.php.
getLastErrorMsg | ( | ) |
Returns the last message from the error stack.
Definition at line 204 of file AbstractService.php.
References AbstractService\$error.
getOutput | ( | ) |
Get the output content.
Definition at line 486 of file AbstractService.php.
References AbstractService\$out, and AbstractService\readFile().
getOutputFile | ( | $absFile = '' | ) |
Get the output file name. If no output file is set, the ->out buffer is written to the file given by input parameter filename
string | $absFile | Absolute filename to write to |
Definition at line 500 of file AbstractService.php.
References AbstractService\$outputFile, and AbstractService\writeFile().
getServiceInfo | ( | ) |
Returns internal information array for service
Definition at line 90 of file AbstractService.php.
References AbstractService\$info.
getServiceKey | ( | ) |
Returns the service key of the service
Definition at line 100 of file AbstractService.php.
getServiceOption | ( | $optionName, | |
$defaultValue = '' , |
|||
$includeDefaultConfig = true |
|||
) |
Returns service configuration values from the $TYPO3_CONF_VARS['SVCONF'] array
string | $optionName | Name of the config option |
mixed | $defaultValue | Default configuration if no special config is available |
bool | $includeDefaultConfig | If set the 'default' config will be returned if no special config for this service is available (default: TRUE) |
Definition at line 123 of file AbstractService.php.
References $GLOBALS, and elseif.
Referenced by AbstractAuthenticationService\initAuth().
getServiceTitle | ( | ) |
Returns the title of the service
Definition at line 110 of file AbstractService.php.
init | ( | ) |
Initialization of the service.
The class have to do a strict check if the service is available. example: check if the perl interpreter is available which is needed to run an extern perl script.
Definition at line 521 of file AbstractService.php.
References AbstractService\checkExec(), AbstractService\getLastError(), and AbstractService\reset().
readFile | ( | $absFile, | |
$length = 0 |
|||
) |
Read content from a file a file.
string | $absFile | File name to read from. |
int | $length | Maximum length to read. If empty the whole file will be read. |
Definition at line 318 of file AbstractService.php.
References AbstractService\$out, AbstractService\checkInputFile(), and AbstractService\errorPush().
Referenced by AbstractService\getInput(), and AbstractService\getOutput().
registerTempFile | ( | $absFile | ) |
Register file which should be deleted afterwards.
string | File name with absolute path. |
Definition at line 379 of file AbstractService.php.
Referenced by AbstractService\tempFile().
reset | ( | ) |
Resets the service. Will be called by init(). Should be used before every use if a service instance is used multiple times.
Definition at line 539 of file AbstractService.php.
References AbstractService\resetErrors(), and AbstractService\unlinkTempFiles().
Referenced by AbstractService\init().
resetErrors | ( | ) |
Reset the error stack.
Definition at line 245 of file AbstractService.php.
Referenced by AbstractService\reset().
setInput | ( | $content, | |
$type = '' |
|||
) |
Set the input content for service processing.
mixed | $content | Input content (going into ->inputContent) |
string | $type | The type of the input content (or file). Might be the same as the service subtypes. |
Definition at line 413 of file AbstractService.php.
setInputFile | ( | $absFile, | |
$type = '' |
|||
) |
Set the input file name for service processing.
string | $absFile | File name |
string | $type | The type of the input content (or file). Might be the same as the service subtypes. |
Definition at line 427 of file AbstractService.php.
setOutputFile | ( | $absFile | ) |
Set the output file name.
string | $absFile | File name |
Definition at line 476 of file AbstractService.php.
tempFile | ( | $filePrefix | ) |
Create a temporary file.
string | $filePrefix | File prefix. |
Definition at line 360 of file AbstractService.php.
References AbstractService\errorPush(), and AbstractService\registerTempFile().
Referenced by AbstractService\writeFile().
unlinkTempFiles | ( | ) |
Delete registered temporary files.
Definition at line 393 of file AbstractService.php.
Referenced by AbstractService\__destruct(), and AbstractService\reset().
writeFile | ( | $content, | |
$absFile = '' |
|||
) |
Write content to a file.
string | $content | Content to write to the file |
string | $absFile | File name to write into. If empty a temp file will be created. |
Definition at line 337 of file AbstractService.php.
References AbstractService\errorPush(), GeneralUtility\isAllowedAbsPath(), and AbstractService\tempFile().
Referenced by AbstractService\getInputFile(), and AbstractService\getOutputFile().
$error = array() |
Definition at line 30 of file AbstractService.php.
Referenced by AbstractService\getErrorMsgArray(), AbstractService\getLastError(), AbstractService\getLastErrorMsg(), and AbstractAuthenticationService\writelog().
$info = array() |
Definition at line 25 of file AbstractService.php.
Referenced by AbstractService\getServiceInfo().
$inputContent = '' |
Definition at line 50 of file AbstractService.php.
Referenced by AbstractService\getInput().
$inputFile = '' |
Definition at line 45 of file AbstractService.php.
Referenced by AbstractService\getInputFile().
$inputType = '' |
Definition at line 55 of file AbstractService.php.
$out = '' |
Definition at line 40 of file AbstractService.php.
Referenced by AbstractService\getOutput(), and AbstractService\readFile().
$outputFile = '' |
Definition at line 60 of file AbstractService.php.
Referenced by AbstractService\getOutputFile().
|
protected |
Definition at line 78 of file AbstractService.php.
|
protected |
Definition at line 73 of file AbstractService.php.
$tempFiles = array() |
Definition at line 68 of file AbstractService.php.
$writeDevLog = false |
Definition at line 35 of file AbstractService.php.