Documentation TYPO3 par Ameos

t3lib_svbase Class Reference

Inheritance diagram for t3lib_svbase:
[legend]
List of all members.

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 occured')
 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 = ''

Detailed Description

Definition at line 125 of file class.t3lib_svbase.php.


Constructor & Destructor Documentation

t3lib_svbase::__destruct (  ) 

Clean up the service.

Returns:
void

Definition at line 698 of file class.t3lib_svbase.php.

References unlinkTempFiles().

Referenced by init().


Member Function Documentation

t3lib_svbase::getServiceInfo (  ) 

Returns internal information array for service

Returns:
array service description array

Definition at line 191 of file class.t3lib_svbase.php.

t3lib_svbase::getServiceKey (  ) 

Returns the service key of the service

Returns:
string service key

Definition at line 201 of file class.t3lib_svbase.php.

t3lib_svbase::getServiceTitle (  ) 

Returns the title of the service

Returns:
string service title

Definition at line 211 of file class.t3lib_svbase.php.

t3lib_svbase::getServiceOption ( optionName,
defaultValue = '',
includeDefaultConfig = TRUE 
)

Returns service configuration values from the $TYPO3_CONF_VARS['SVCONF'] array

Parameters:
string Name of the config option
boolean If set the 'default' config will be return if no special config for this service is available (default: true)
[type] $includeDefaultConfig: ...
Returns:
mixed configuration value for the service

Definition at line 224 of file class.t3lib_svbase.php.

Referenced by tx_sv_authbase::initAuth().

t3lib_svbase::devLog ( msg,
severity = 0,
dataVar = FALSE 
)

Logs debug messages to t3lib_div::devLog()

Parameters:
string Debug message
integer Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message
array Additional data you want to pass to the logger.
Returns:
void

Definition at line 259 of file class.t3lib_svbase.php.

References t3lib_div::devLog().

t3lib_svbase::errorPush ( errNum = T3_ERR_SV_GENERAL,
errMsg = 'Unspecified error occured' 
)

Puts an error on the error stack. Calling without parameter adds a general error.

Parameters:
string error message
string error number (see T3_ERR_SV_* constants)
Returns:
void

Definition at line 273 of file class.t3lib_svbase.php.

Referenced by checkExec(), checkInputFile(), readFile(), tempFile(), and writeFile().

t3lib_svbase::errorPull (  ) 

Removes the last error from the error stack.

Returns:
void

Definition at line 288 of file class.t3lib_svbase.php.

t3lib_svbase::getLastError (  ) 

Returns the last error number from the error stack.

Returns:
string error number

Definition at line 300 of file class.t3lib_svbase.php.

References $error.

Referenced by init().

t3lib_svbase::getLastErrorMsg (  ) 

Returns the last message from the error stack.

Returns:
string error message

Definition at line 315 of file class.t3lib_svbase.php.

References $error.

t3lib_svbase::getErrorMsgArray (  ) 

Returns all error messages as array.

Returns:
array error messages

Definition at line 330 of file class.t3lib_svbase.php.

References $error, and reset().

t3lib_svbase::getLastErrorArray (  ) 

Returns the last array from the error stack.

Returns:
array error nr and message

Definition at line 348 of file class.t3lib_svbase.php.

t3lib_svbase::resetErrors (  ) 

Reset the error stack.

Returns:
void

Definition at line 357 of file class.t3lib_svbase.php.

Referenced by reset().

t3lib_svbase::checkExec ( progList  ) 

check the availability of external programs

Parameters:
string comma list of programs 'perl,python,pdftotext'
Returns:
boolean return FALSE if one program was not found

Definition at line 377 of file class.t3lib_svbase.php.

References t3lib_exec::checkCommand(), errorPush(), and t3lib_div::trimExplode().

Referenced by init().

t3lib_svbase::deactivateService (  ) 

Deactivate the service. Use this if the service fails at runtime and will not be available.

Returns:
void

Definition at line 401 of file class.t3lib_svbase.php.

References t3lib_extMgm::deactivateService().

t3lib_svbase::checkInputFile ( absFile  ) 

Check if a file exists and is readable.

Parameters:
string File name with absolute path.
Returns:
string File name or FALSE.

Definition at line 427 of file class.t3lib_svbase.php.

References errorPush(), and t3lib_div::isAllowedAbsPath().

Referenced by getInputFile(), and readFile().

t3lib_svbase::readFile ( absFile,
length = 0 
)

Read content from a file a file.

Parameters:
string File name to read from.
integer Maximum length to read. If empty the whole file will be read.
Returns:
string $content or FALSE

Definition at line 448 of file class.t3lib_svbase.php.

References $out, checkInputFile(), and errorPush().

Referenced by getInput(), and getOutput().

t3lib_svbase::writeFile ( content,
absFile = '' 
)

Write content to a file.

Parameters:
string Content to write to the file
string File name to write into. If empty a temp file will be created.
Returns:
string File name or FALSE

Definition at line 468 of file class.t3lib_svbase.php.

References errorPush(), t3lib_div::isAllowedAbsPath(), and tempFile().

Referenced by getInputFile(), and getOutputFile().

t3lib_svbase::tempFile ( filePrefix  ) 

Create a temporary file.

Parameters:
string File prefix.
Returns:
string File name or FALSE

Definition at line 494 of file class.t3lib_svbase.php.

References errorPush(), registerTempFile(), and t3lib_div::tempnam().

Referenced by writeFile().

t3lib_svbase::registerTempFile ( absFile  ) 

Register file which should be deleted afterwards.

Parameters:
string File name with absolute path.
Returns:
void

Definition at line 512 of file class.t3lib_svbase.php.

Referenced by tempFile().

t3lib_svbase::unlinkTempFiles (  ) 

Delete registered temporary files.

Parameters:
string File name with absolute path.
Returns:
void

Definition at line 522 of file class.t3lib_svbase.php.

References t3lib_div::unlink_tempfile().

Referenced by __destruct(), and reset().

t3lib_svbase::setInput ( content,
type = '' 
)

Set the input content for service processing.

Parameters:
mixed Input content (going into ->inputContent)
string The type of the input content (or file). Might be the same as the service subtypes.
Returns:
void

Definition at line 544 of file class.t3lib_svbase.php.

t3lib_svbase::setInputFile ( absFile,
type = '' 
)

Set the input file name for service processing.

Parameters:
string file name
string The type of the input content (or file). Might be the same as the service subtypes.
Returns:
void

Definition at line 558 of file class.t3lib_svbase.php.

t3lib_svbase::getInput (  ) 

Get the input content. Will be read from input file if needed. (That is if ->inputContent is empty and ->inputFile is not)

Returns:
mixed

Definition at line 571 of file class.t3lib_svbase.php.

References readFile().

t3lib_svbase::getInputFile ( createFile = ''  ) 

Get the input file name. If the content was set by setContent a file will be created.

Parameters:
string File name. If empty a temp file will be created.
Returns:
string File name or FALSE if no input or file error.

Definition at line 586 of file class.t3lib_svbase.php.

References checkInputFile(), and writeFile().

t3lib_svbase::setOutputFile ( absFile  ) 

Set the output file name.

Parameters:
string file name
Returns:
void

Definition at line 611 of file class.t3lib_svbase.php.

t3lib_svbase::getOutput (  ) 

Get the output content.

Returns:
mixed

Definition at line 621 of file class.t3lib_svbase.php.

References readFile().

t3lib_svbase::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

Parameters:
string Absolute filename to write to
Returns:
mixed

Definition at line 635 of file class.t3lib_svbase.php.

References writeFile().

t3lib_svbase::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.

Returns:
boolean TRUE if the service is available

Definition at line 659 of file class.t3lib_svbase.php.

References __destruct(), checkExec(), getLastError(), and reset().

t3lib_svbase::reset (  ) 

Resets the service. Will be called by init(). Should be used before every use if a service instance is used multiple times.

Returns:
void

Definition at line 683 of file class.t3lib_svbase.php.

References resetErrors(), and unlinkTempFiles().

Referenced by getErrorMsgArray(), and init().


Member Data Documentation

t3lib_svbase::$info = array()

service description array

Definition at line 130 of file class.t3lib_svbase.php.

t3lib_svbase::$error = array()

error stack

Definition at line 135 of file class.t3lib_svbase.php.

Referenced by getErrorMsgArray(), getLastError(), getLastErrorMsg(), and tx_sv_authbase::writelog().

t3lib_svbase::$writeDevLog = false

Defines if debug messages should be written with t3lib_div::devLog

Reimplemented in tx_sv_authbase.

Definition at line 140 of file class.t3lib_svbase.php.

t3lib_svbase::$out = ''

The output content. That's what the services produced as result.

Definition at line 147 of file class.t3lib_svbase.php.

Referenced by readFile().

t3lib_svbase::$inputFile = ''

The file that should be processed.

Definition at line 152 of file class.t3lib_svbase.php.

t3lib_svbase::$inputContent = ''

The content that should be processed.

Definition at line 157 of file class.t3lib_svbase.php.

t3lib_svbase::$inputType = ''

The type of the input content (or file). Might be the same as the service subtypes.

Definition at line 162 of file class.t3lib_svbase.php.

t3lib_svbase::$outputFile = ''

The file where the output should be written to.

Definition at line 167 of file class.t3lib_svbase.php.


The documentation for this class was generated from the following file:


Généré par Les spécialistes TYPO3 avec  doxygen 1.4.6