Project

General

Profile

Task #24551 » getURL-t3lib.diff

Administrator Admin, 2011-01-13 14:13

View differences:

t3lib/class.t3lib_befunc.php
if (substr($ds_array[$srcPointer], 0, 5) == 'FILE:') {
$file = t3lib_div::getFileAbsFileName(substr($ds_array[$srcPointer], 5));
if ($file && @is_file($file)) {
$dataStructArray = t3lib_div::xml2array(t3lib_div::getUrl($file));
$dataStructArray = t3lib_div::xml2array(t3lib_div::getURL($file));
} else {
$dataStructArray = 'The file "' . substr($ds_array[$srcPointer], 5) . '" in ds-array key "' . $srcPointer . '" was not found ("' . $file . '")';
} // Error message.
......
} else { // Otherwise expect it to be a file:
$file = t3lib_div::getFileAbsFileName($srcPointer);
if ($file && @is_file($file)) {
$dataStructArray = t3lib_div::xml2array(t3lib_div::getUrl($file));
$dataStructArray = t3lib_div::xml2array(t3lib_div::getURL($file));
} else {
$dataStructArray = 'The file "' . $srcPointer . '" was not found ("' . $file . '")';
} // Error message.
......
if (!is_array($dataStruct)) {
$file = t3lib_div::getFileAbsFileName(str_ireplace('FILE:', '', $dataStruct));
if ($file && @is_file($file)) {
$dataStruct = t3lib_div::getUrl($file);
$dataStruct = t3lib_div::getURL($file);
}
$dataStruct = t3lib_div::xml2array($dataStruct);
if (!is_array($dataStruct)) {
t3lib/class.t3lib_compressor.php
$concatenated = '';
// concatenate all the files together
foreach ($filesToInclude as $filename) {
$contents = t3lib_div::getUrl(t3lib_div::resolveBackPath(PATH_typo3 . $filename));
$contents = t3lib_div::getURL(t3lib_div::resolveBackPath(PATH_typo3 . $filename));
// only fix paths if files aren't already in typo3temp (already processed)
if (!t3lib_div::isFirstPartOfStr($filename, $this->targetDirectory)) {
$concatenated .= $this->cssFixRelativeUrlPaths($contents, dirname($filename) . '/');
......
$targetFile = $this->targetDirectory . $pathinfo['filename'] . '-' . md5($unique) . '.css';
// only create it, if it doesn't exist, yet
if (!file_exists(PATH_site . $targetFile) || ($this->createGzipped && !file_exists(PATH_site . $targetFile . '.gzip'))) {
$contents = t3lib_div::getUrl($filenameAbsolute);
$contents = t3lib_div::getURL($filenameAbsolute);
// Perform some safe CSS optimizations.
$contents = str_replace("\r", '', $contents); // Strip any and all carriage returns.
// Match and process strings, comments and everything else, one chunk at a time.
......
$targetFile = $this->targetDirectory . $pathinfo['filename'] . '-' . md5($unique) . '.js';
// only create it, if it doesn't exist, yet
if (!file_exists(PATH_site . $targetFile) || ($this->createGzipped && !file_exists(PATH_site . $targetFile . '.gzip'))) {
$contents = t3lib_div::getUrl($filenameAbsolute);
$contents = t3lib_div::getURL($filenameAbsolute);
$this->writeFileAndCompressed($targetFile, $contents);
}
return $GLOBALS['BACK_PATH'] . '../' . $this->returnFileReference($targetFile);
t3lib/class.t3lib_cs.php
// Caching brought parsing time for gb2312 down from 2400 ms to 150 ms. For other charsets we are talking 11 ms down to zero.
$cacheFile = t3lib_div::getFileAbsFileName('typo3temp/cs/charset_' . $charset . '.tbl');
if ($cacheFile && @is_file($cacheFile)) {
$this->parsedCharsets[$charset] = unserialize(t3lib_div::getUrl($cacheFile));
$this->parsedCharsets[$charset] = unserialize(t3lib_div::getURL($cacheFile));
} else {
// Parse conversion table into lines:
$lines = t3lib_div::trimExplode(LF, t3lib_div::getUrl($charsetConvTableFile), 1);
$lines = t3lib_div::trimExplode(LF, t3lib_div::getURL($charsetConvTableFile), 1);
// Initialize the internal variable holding the conv. table:
$this->parsedCharsets[$charset] = array('local' => array(), 'utf8' => array());
// traverse the lines:
......
// Use cached version if possible
if ($cacheFileCase && @is_file($cacheFileCase)) {
$this->caseFolding['utf-8'] = unserialize(t3lib_div::getUrl($cacheFileCase));
$this->caseFolding['utf-8'] = unserialize(t3lib_div::getURL($cacheFileCase));
return 2;
}
break;
......
// Use cached version if possible
if ($cacheFileASCII && @is_file($cacheFileASCII)) {
$this->toASCII['utf-8'] = unserialize(t3lib_div::getUrl($cacheFileASCII));
$this->toASCII['utf-8'] = unserialize(t3lib_div::getURL($cacheFileASCII));
return 2;
}
break;
......
// Use cached version if possible
$cacheFile = t3lib_div::getFileAbsFileName('typo3temp/cs/cscase_' . $charset . '.tbl');
if ($cacheFile && @is_file($cacheFile)) {
$this->caseFolding[$charset] = unserialize(t3lib_div::getUrl($cacheFile));
$this->caseFolding[$charset] = unserialize(t3lib_div::getURL($cacheFile));
return 2;
}
......
// Use cached version if possible
$cacheFile = t3lib_div::getFileAbsFileName('typo3temp/cs/csascii_' . $charset . '.tbl');
if ($cacheFile && @is_file($cacheFile)) {
$this->toASCII[$charset] = unserialize(t3lib_div::getUrl($cacheFile));
$this->toASCII[$charset] = unserialize(t3lib_div::getURL($cacheFile));
return 2;
}
t3lib/class.t3lib_div.php
}
} else {
// Get content from cache:
$serContent = unserialize(self::getUrl($cacheFileName));
$serContent = unserialize(self::getURL($cacheFileName));
$LOCAL_LANG = $serContent['LOCAL_LANG'];
}
......
if (!@is_file($cacheFileName)) { // ... if it doesn't, create content and write it:
// Read XML, parse it.
$xmlString = self::getUrl($fileRef);
$xmlString = self::getURL($fileRef);
$xmlContent = self::xml2array($xmlString);
if (!is_array($xmlContent)) {
$fileName = substr($fileRef, strlen(PATH_site));
......
}
} else {
// Get content from cache:
$serContent = unserialize(self::getUrl($cacheFileName));
$serContent = unserialize(self::getURL($cacheFileName));
$LOCAL_LANG = $serContent['LOCAL_LANG'];
}
......
if (!@is_file($cacheFileName)) { // ... if it doesn't, create content and write it:
// Read and parse XML content:
$local_xmlString = self::getUrl($localized_file);
$local_xmlString = self::getURL($localized_file);
$local_xmlContent = self::xml2array($local_xmlString);
if (!is_array($local_xmlContent)) {
$fileName = substr($localized_file, strlen(PATH_site));
......
}
} else {
// Get content from cache:
$serContent = unserialize(self::getUrl($cacheFileName));
$serContent = unserialize(self::getURL($cacheFileName));
$LOCAL_LANG[$langKey] = $serContent['EXT_DATA'];
}
} else {
......
if ($dataStruct && !is_array($dataStruct)) {
$file = self::getFileAbsFileName($dataStruct);
if ($file && @is_file($file)) {
$dataStruct = self::xml2array(self::getUrl($file));
$dataStruct = self::xml2array(self::getURL($file));
}
}
} else {
t3lib/class.t3lib_extmgm.php
if (is_array($conf)) {
if ($conf['ext_localconf.php']) {
$cFiles['ext_localconf'] .= self::_makeIncludeHeader($key, $conf['ext_localconf.php']);
$cFiles['ext_localconf'] .= trim(t3lib_div::getUrl($conf['ext_localconf.php']));
$cFiles['ext_localconf'] .= trim(t3lib_div::getURL($conf['ext_localconf.php']));
}
if ($conf['ext_tables.php']) {
$cFiles['ext_tables'] .= self::_makeIncludeHeader($key, $conf['ext_tables.php']);
$cFiles['ext_tables'] .= trim(t3lib_div::getUrl($conf['ext_tables.php']));
$cFiles['ext_tables'] .= trim(t3lib_div::getURL($conf['ext_tables.php']));
}
}
}
t3lib/class.t3lib_install.php
}
// Splitting localconf.php file into lines:
$lines = explode(LF, str_replace(CR, '', trim(t3lib_div::getUrl($writeToLocalconf_dat['file']))));
$lines = explode(LF, str_replace(CR, '', trim(t3lib_div::getURL($writeToLocalconf_dat['file']))));
$writeToLocalconf_dat['endLine'] = array_pop($lines); // Getting "? >" ending.
// Checking if "updated" line was set by this tool - if so remove old line.
......
if (!t3lib_div::writeFile($writeToLocalconf_dat['tmpfile'], implode(LF, $lines))) {
$msg = 'typo3conf/localconf.php' . $tmpExt . ' could not be written - maybe a write access problem?';
}
elseif (strcmp(t3lib_div::getUrl($writeToLocalconf_dat['tmpfile']), implode(LF, $lines))) {
elseif (strcmp(t3lib_div::getURL($writeToLocalconf_dat['tmpfile']), implode(LF, $lines))) {
@unlink($writeToLocalconf_dat['tmpfile']);
$msg = 'typo3conf/localconf.php' . $tmpExt . ' was NOT written properly (written content didn\'t match file content) - maybe a disk space problem?';
}
t3lib/class.t3lib_parsehtml_proc.php
// External image from another URL? In that case, fetch image (unless disabled feature).
if (!t3lib_div::isFirstPartOfStr($absRef, $siteUrl) && !$this->procOptions['dontFetchExtPictures']) {
$externalFile = $this->getUrl($absRef); // Get it
$externalFile = $this->getURL($absRef); // Get it
if ($externalFile) {
$pU = parse_url($absRef);
$pI = pathinfo($pU['path']);
t3lib/class.t3lib_tcemain.php
// Write file configuration:
if (is_array($eFile)) {
$mixedRec = array_merge($currentRecord, $fieldArray);
$SW_fileContent = t3lib_div::getUrl($eFile['editFile']);
$SW_fileContent = t3lib_div::getURL($eFile['editFile']);
$parseHTML = t3lib_div::makeInstance('t3lib_parsehtml_proc');
/* @var $parseHTML t3lib_parsehtml_proc */
$parseHTML->init('', '');
t3lib/class.t3lib_transferdata.php
if (is_array($eFile)) {
if ($eFile['loadFromFileField'] && $totalRecordContent[$eFile['loadFromFileField']]) {
// Read the external file, and insert the content between the ###TYPO3_STATICFILE_EDIT### markers:
$SW_fileContent = t3lib_div::getUrl($eFile['editFile']);
$SW_fileContent = t3lib_div::getURL($eFile['editFile']);
$parseHTML = t3lib_div::makeInstance('t3lib_parsehtml_proc');
$parseHTML->init('', '');
t3lib/class.t3lib_tsparser.php
if (@is_file($filename) && filesize($filename) < 100000) { // Max. 100 KB include files!
// check for includes in included text
$includedFiles[] = $filename;
$included_text = self::checkIncludeLines(t3lib_div::getUrl($filename), $cycle_counter + 1, $returnFiles);
$included_text = self::checkIncludeLines(t3lib_div::getURL($filename), $cycle_counter + 1, $returnFiles);
// If the method also has to return all included files, merge currently included
// files with files included by recursively calling itself
if ($returnFiles && is_array($included_text)) {
t3lib/class.t3lib_tstemplate.php
if (@is_dir($ISF_filePath)) {
$mExtKey = str_replace('_', '', $ISF_extKey . '/' . $ISF_localPath);
$subrow = array(
'constants' => @is_file($ISF_filePath . 'constants.txt') ? t3lib_div::getUrl($ISF_filePath . 'constants.txt') : '',
'config' => @is_file($ISF_filePath . 'setup.txt') ? t3lib_div::getUrl($ISF_filePath . 'setup.txt') : '',
'editorcfg' => @is_file($ISF_filePath . 'editorcfg.txt') ? t3lib_div::getUrl($ISF_filePath . 'editorcfg.txt') : '',
'include_static' => @is_file($ISF_filePath . 'include_static.txt') ? implode(',', array_unique(t3lib_div::intExplode(',', t3lib_div::getUrl($ISF_filePath . 'include_static.txt')))) : '',
'include_static_file' => @is_file($ISF_filePath . 'include_static_file.txt') ? implode(',', array_unique(explode(',', t3lib_div::getUrl($ISF_filePath . 'include_static_file.txt')))) : '',
'constants' => @is_file($ISF_filePath . 'constants.txt') ? t3lib_div::getURL($ISF_filePath . 'constants.txt') : '',
'config' => @is_file($ISF_filePath . 'setup.txt') ? t3lib_div::getURL($ISF_filePath . 'setup.txt') : '',
'editorcfg' => @is_file($ISF_filePath . 'editorcfg.txt') ? t3lib_div::getURL($ISF_filePath . 'editorcfg.txt') : '',
'include_static' => @is_file($ISF_filePath . 'include_static.txt') ? implode(',', array_unique(t3lib_div::intExplode(',', t3lib_div::getURL($ISF_filePath . 'include_static.txt')))) : '',
'include_static_file' => @is_file($ISF_filePath . 'include_static_file.txt') ? implode(',', array_unique(explode(',', t3lib_div::getURL($ISF_filePath . 'include_static_file.txt')))) : '',
'title' => $ISF_file,
'uid' => $mExtKey
);
......
if (is_array($files) && ($files['ext_typoscript_constants.txt'] || $files['ext_typoscript_setup.txt'] || $files['ext_typoscript_editorcfg.txt'])) {
$mExtKey = str_replace('_', '', $extKey);
$subrow = array(
'constants' => $files['ext_typoscript_constants.txt'] ? t3lib_div::getUrl($files['ext_typoscript_constants.txt']) : '',
'config' => $files['ext_typoscript_setup.txt'] ? t3lib_div::getUrl($files['ext_typoscript_setup.txt']) : '',
'editorcfg' => $files['ext_typoscript_editorcfg.txt'] ? t3lib_div::getUrl($files['ext_typoscript_editorcfg.txt']) : '',
'constants' => $files['ext_typoscript_constants.txt'] ? t3lib_div::getURL($files['ext_typoscript_constants.txt']) : '',
'config' => $files['ext_typoscript_setup.txt'] ? t3lib_div::getURL($files['ext_typoscript_setup.txt']) : '',
'editorcfg' => $files['ext_typoscript_editorcfg.txt'] ? t3lib_div::getURL($files['ext_typoscript_editorcfg.txt']) : '',
'title' => $extKey,
'uid' => $mExtKey
);
......
/**
* Reads the fileContent of $fName and returns it.
* Similar to t3lib_div::getUrl()
* Similar to t3lib_div::getURL()
*
* @param string Absolute filepath to record
* @return string The content returned
* @see tslib_cObj::fileResource(), tslib_cObj::MULTIMEDIA(), t3lib_div::getUrl()
* @see tslib_cObj::fileResource(), tslib_cObj::MULTIMEDIA(), t3lib_div::getURL()
*/
function fileContent($fName) {
$incFile = $this->getFileName($fName);
t3lib/message/class.t3lib_message_errorpagemessage.php
'###TYPO3_mainDir###' => TYPO3_mainDir,
);
$content = t3lib_div::getUrl(PATH_site . $this->htmlTemplate);
$content = t3lib_div::getURL(PATH_site . $this->htmlTemplate);
$content = t3lib_parseHtml::substituteMarkerArray($content, $markers, '', FALSE, TRUE);
return $content;
}
(2-2/21)