112 return $this->info[
'serviceKey'];
122 return $this->info[
'title'];
134 public function getServiceOption($optionName, $defaultValue =
'', $includeDefaultConfig = TRUE) {
136 $svOptions =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SVCONF'][$this->info[
'serviceType']];
137 if (isset($svOptions[$this->info[
'serviceKey']][$optionName])) {
138 $config = $svOptions[$this->info[
'serviceKey']][$optionName];
139 } elseif ($includeDefaultConfig && isset($svOptions[
'default'][$optionName])) {
140 $config = $svOptions[
'default'][$optionName];
142 if (!isset($config)) {
143 $config = $defaultValue;
162 public function devLog($msg, $severity = 0, $dataVar = FALSE) {
163 if ($this->writeDevLog) {
176 public function errorPush($errNum = T3_ERR_SV_GENERAL, $errMsg =
'Unspecified error occurred') {
177 array_push($this->error, array(
'nr' => $errNum,
'msg' => $errMsg));
179 $GLOBALS[
'TT']->setTSlogMessage($errMsg, 2);
190 array_pop($this->error);
202 if (count($this->error)) {
203 $error = end($this->error);
204 $lastError =
$error[
'nr'];
216 $lastErrorMessage =
'';
217 if (count($this->error)) {
218 $error = end($this->error);
219 $lastErrorMessage =
$error[
'msg'];
221 return $lastErrorMessage;
232 if (count($this->error)) {
233 foreach ($this->error as
$error) {
234 $errArr[] = $error[
'msg'];
247 return end($this->error);
257 $this->error = array();
275 foreach ($progList as $prog) {
276 if (!\
TYPO3\CMS\Core\Utility\CommandUtility::checkCommand($prog)) {
278 $this->
errorPush(T3_ERR_SV_PROG_NOT_FOUND,
'External program not found: ' . $prog);
308 $checkResult = FALSE;
309 if (\
TYPO3\CMS\Core\Utility\GeneralUtility::isAllowedAbsPath($absFile) && @is_file($absFile)) {
310 if (@is_readable($absFile)) {
311 $checkResult = $absFile;
313 $this->
errorPush(T3_ERR_SV_FILE_READ,
'File is not readable: ' . $absFile);
316 $this->
errorPush(T3_ERR_SV_FILE_NOT_FOUND,
'File not found: ' . $absFile);
332 $out = file_get_contents($absFile);
333 if (
$out === FALSE) {
334 $this->
errorPush(T3_ERR_SV_FILE_READ,
'Can not read from file: ' . $absFile);
350 $absFile = $this->
tempFile($this->prefixId);
352 if ($absFile && \
TYPO3\CMS\Core\Utility\GeneralUtility::isAllowedAbsPath($absFile)) {
353 if ($fd = @fopen($absFile,
'wb')) {
354 @fwrite($fd, $content);
357 $this->
errorPush(T3_ERR_SV_FILE_WRITE,
'Can not write to file: ' . $absFile);
378 $this->
errorPush(T3_ERR_SV_FILE_WRITE,
'Can not create temp file.');
391 if (!isset($this->shutdownRegistry[__METHOD__])) {
392 register_shutdown_function(array($this,
'unlinkTempFiles'));
393 $this->shutdownRegistry[__METHOD__] = TRUE;
395 $this->tempFiles[] = $absFile;
405 foreach ($this->tempFiles as $absFile) {
408 $this->tempFiles = array();
425 $this->inputContent = $content;
426 $this->inputFile =
'';
427 $this->inputType = $type;
439 $this->inputContent =
'';
440 $this->inputFile = $absFile;
441 $this->inputType = $type;
452 if ($this->inputContent ==
'') {
453 $this->inputContent = $this->
readFile($this->inputFile);
467 if ($this->inputFile) {
469 } elseif ($this->inputContent) {
470 $this->inputFile = $this->
writeFile($this->inputContent, $createFile);
488 $this->outputFile = $absFile;
498 if ($this->outputFile) {
499 $this->out = $this->
readFile($this->outputFile);
512 if (!$this->outputFile) {
513 $this->outputFile = $this->
writeFile($this->out, $absFile);
536 if (trim($this->info[
'exec'])) {
537 if (!$this->
checkExec($this->info[
'exec'])) {
555 $this->inputFile =
'';
556 $this->inputContent =
'';
557 $this->inputType =
'';
558 $this->outputFile =
'';
static unlink_tempfile($uploadedTempFileName)
setInputFile($absFile, $type='')
readFile($absFile, $length=0)
static devLog($msg, $extKey, $severity=0, $dataVar=FALSE)
getServiceOption($optionName, $defaultValue='', $includeDefaultConfig=TRUE)
setInput($content, $type='')
getOutputFile($absFile='')
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
writeFile($content, $absFile='')
devLog($msg, $severity=0, $dataVar=FALSE)
registerTempFile($absFile)
static deactivateService($serviceType, $serviceKey)
static tempnam($filePrefix, $fileSuffix='')
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
errorPush($errNum=T3_ERR_SV_GENERAL, $errMsg='Unspecified error occurred')
getInputFile($createFile='')