本文整理汇总了PHP中t3lib_div::getFileAbsFileName方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_div::getFileAbsFileName方法的具体用法?PHP t3lib_div::getFileAbsFileName怎么用?PHP t3lib_div::getFileAbsFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_div
的用法示例。
在下文中一共展示了t3lib_div::getFileAbsFileName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Renders Lorem Ipsum paragraphs. If $lipsum is provided it
* will be used as source text. If not provided as an argument
* or as inline argument, $lipsum is fetched from TypoScript settings.
*
* @param string $lipsum String of paragraphs file path or EXT:myext/path/to/file
* @return string
*/
public function render($lipsum = NULL)
{
if (strlen($lipsum) === 0) {
$this->getDefaultLoremIpsum();
}
if (strlen($lipsum) < 255 && !preg_match('/[^a-z0-9_\\./]/i', $lipsum)) {
// argument is most likely a file reference.
$sourceFile = t3lib_div::getFileAbsFileName($lipsum);
if (file_exists($sourceFile) === TRUE) {
$lipsum = file_get_contents($sourceFile);
} else {
t3lib_div::sysLog('Vhs LipsumViewHelper was asked to load Lorem Ipsum from a file which does not exist. ' . 'The file was: ' . $sourceFile, 'Vhs');
$lipsum = $this->getDefaultLoremIpsum();
}
}
$lipsum = preg_replace('/[\\r\\n]{1,}/i', "\n", $lipsum);
$paragraphs = explode("\n", $lipsum);
$paragraphs = array_slice($paragraphs, 0, intval($settings['paragraphs']));
foreach ($paragraphs as $index => $paragraph) {
$length = $settings['wordsPerParagraph'] + rand(0 - intval($settings['skew']), intval($settings['skew']));
$words = explode(' ', $paragraph);
$paragraphs[$index] = implode(' ', array_slice($words, 0, $length));
}
$lipsum = implode("\n", $paragraphs);
if ((bool) $settings['html'] === TRUE) {
$lipsum = $this->contentObject->parseFunc($lipsum, array(), '< ' . $settings['parseFuncTSPath']);
}
return $lipsum;
}
示例2: getSystemLanguages
/**
* Returns array of system languages
* @param integer page id (only used to get TSconfig configuration setting flag and label for default language)
* @param string Backpath for flags
* @return array
*/
function getSystemLanguages($page_id = 0, $backPath = '')
{
global $TCA, $LANG;
// Icons and language titles:
t3lib_div::loadTCA('sys_language');
$flagAbsPath = t3lib_div::getFileAbsFileName($TCA['sys_language']['columns']['flag']['config']['fileFolder']);
$flagIconPath = $backPath . '../' . substr($flagAbsPath, strlen(PATH_site));
$modSharedTSconfig = t3lib_BEfunc::getModTSconfig($page_id, 'mod.SHARED');
$languageIconTitles = array();
// Set default:
$languageIconTitles[0] = array('uid' => 0, 'title' => strlen($modSharedTSconfig['properties']['defaultLanguageLabel']) ? $modSharedTSconfig['properties']['defaultLanguageLabel'] . ' (' . $LANG->getLL('defaultLanguage') . ')' : $LANG->getLL('defaultLanguage'), 'ISOcode' => 'DEF', 'flagIcon' => strlen($modSharedTSconfig['properties']['defaultLanguageFlag']) && @is_file($flagAbsPath . $modSharedTSconfig['properties']['defaultLanguageFlag']) ? $flagIconPath . $modSharedTSconfig['properties']['defaultLanguageFlag'] : null);
// Set "All" language:
$languageIconTitles[-1] = array('uid' => -1, 'title' => $LANG->getLL('multipleLanguages'), 'ISOcode' => 'DEF', 'flagIcon' => $flagIconPath . 'multi-language.gif');
// Find all system languages:
$sys_languages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_language', '');
foreach ($sys_languages as $row) {
$languageIconTitles[$row['uid']] = $row;
if ($row['static_lang_isocode'] && t3lib_extMgm::isLoaded('static_info_tables')) {
$staticLangRow = t3lib_BEfunc::getRecord('static_languages', $row['static_lang_isocode'], 'lg_iso_2');
if ($staticLangRow['lg_iso_2']) {
$languageIconTitles[$row['uid']]['ISOcode'] = $staticLangRow['lg_iso_2'];
}
}
if (strlen($row['flag'])) {
$languageIconTitles[$row['uid']]['flagIcon'] = @is_file($flagAbsPath . $row['flag']) ? $flagIconPath . $row['flag'] : '';
}
}
return $languageIconTitles;
}
示例3: loadConfig4BE
/**
* Lädt ein COnfigurations Objekt nach mit der TS aus der Extension
* Dabei wird alles geholt was in "plugin.tx_$extKey", "lib.$extKey." und
* "lib.links." liegt
*
* @param string $extKey Extension, deren TS Config geladen werden soll
* @param string $extKeyTS Extension, deren Konfig innerhalb der
* TS Config geladen werden soll.
* Es kann also zb. das TS von mklib geladen werden aber darin die konfig für
* das plugin von mkxyz
* @param string $sStaticPath pfad zum TS
* @param array $aConfig zusätzliche Konfig, die die default überschreibt
* @param boolean $resolveReferences sollen referenzen die in lib.
* und plugin.tx_$extKeyTS stehen aufgelöst werden?
* @param boolean $forceTsfePreparation
* @return tx_rnbase_configurations
*/
public static function loadConfig4BE($extKey, $extKeyTs = null, $sStaticPath = '', $aConfig = array(), $resolveReferences = false, $forceTsfePreparation = false)
{
$extKeyTs = is_null($extKeyTs) ? $extKey : $extKeyTs;
if (!$sStaticPath) {
$sStaticPath = '/static/ts/setup.txt';
}
if (file_exists(t3lib_div::getFileAbsFileName('EXT:' . $extKey . $sStaticPath))) {
t3lib_extMgm::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $extKey . $sStaticPath . '">');
}
tx_rnbase::load('tx_rnbase_configurations');
tx_rnbase::load('tx_rnbase_util_Misc');
$tsfePreparationOptions = array();
if ($forceTsfePreparation) {
$tsfePreparationOptions['force'] = true;
}
// Ist bei Aufruf aus BE notwendig! (@TODO: sicher???)
tx_rnbase_util_Misc::prepareTSFE($tsfePreparationOptions);
$GLOBALS['TSFE']->config = array();
$cObj = t3lib_div::makeInstance('tslib_cObj');
$pageTsConfig = self::getPagesTSconfig(0);
$tempConfig = $pageTsConfig['plugin.']['tx_' . $extKeyTs . '.'];
$tempConfig['lib.'][$extKeyTs . '.'] = $pageTsConfig['lib.'][$extKeyTs . '.'];
$tempConfig['lib.']['links.'] = $pageTsConfig['lib.']['links.'];
if ($resolveReferences) {
$GLOBALS['TSFE']->tmpl->setup['lib.'][$extKeyTs . '.'] = $tempConfig['lib.'][$extKeyTs . '.'];
$GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_' . $extKeyTs . '.'] = $pageTsConfig['plugin.']['tx_' . $extKeyTs . '.'];
}
$pageTsConfig = $tempConfig;
$qualifier = $pageTsConfig['qualifier'] ? $pageTsConfig['qualifier'] : $extKeyTs;
// möglichkeit die default konfig zu überschreiben
$pageTsConfig = t3lib_div::array_merge_recursive_overrule($pageTsConfig, $aConfig);
$configurations = new tx_rnbase_configurations();
$configurations->init($pageTsConfig, $cObj, $extKeyTs, $qualifier);
return $configurations;
}
示例4: create
/**
* Factory method which creates the specified cache along with the specified kind of backend.
* After creating the cache, it will be registered at the cache manager.
*
* @param string $cacheIdentifier The name / identifier of the cache to create
* @param string $cacheName Name of the cache frontend
* @param string $backendName Name of the cache backend
* @param array $backendOptions (optional) Array of backend options
* @return t3lib_cache_frontend_Frontend The created cache frontend
* @author Robert Lemke <robert@typo3.org>
*/
public function create($cacheIdentifier, $cacheName, $backendName, array $backendOptions = array())
{
// loading the cache backend file and class
list($backendFile, $backendClassReference) = explode(':', $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheBackends'][$backendName]);
$backendRequireFile = t3lib_div::getFileAbsFileName($backendFile);
if ($backendRequireFile) {
t3lib_div::requireOnce($backendRequireFile);
}
$backend = t3lib_div::makeInstance($backendClassReference, $backendOptions);
if (!$backend instanceof t3lib_cache_backend_Backend) {
throw new t3lib_cache_exception_InvalidCache('"' . $backendName . '" is not a valid cache backend.', 1216304301);
}
// loading the cache frontend file and class
list($cacheFile, $cacheClassReference) = explode(':', $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheFrontends'][$cacheName]);
$cacheRequireFile = t3lib_div::getFileAbsFileName($cacheFile);
if ($cacheRequireFile) {
t3lib_div::requireOnce($cacheRequireFile);
}
$cache = t3lib_div::makeInstance($cacheClassReference, $cacheIdentifier, $backend);
if (!$cache instanceof t3lib_cache_frontend_Frontend) {
throw new t3lib_cache_exception_InvalidCache('"' . $cacheName . '" is not a valid cache.', 1216304300);
}
$this->cacheManager->registerCache($cache);
return $cache;
}
示例5: main
/**
* The main method of the PlugIn
*
* @param string $content: The PlugIn content
* @param array $conf: The PlugIn configuration
* @return The content that is displayed on the website
*/
function main($content, $conf)
{
$this->conf = $conf;
$this->bootstrap();
$yahooapi = new yahooApiResolver();
$yahooapi->setUnit($this->conf["unit"]);
$yahooapi->setTimeout($this->conf["timeout"]);
$yahooapi->setLocationCode($this->conf["location"]);
//Configure API Cache
$yahooapi->setCacheTime($this->conf["cacheTime"]);
$yahooapi->setCachePath(t3lib_div::getFileAbsFileName("uploads/tx_adicoweather"));
$yahooapi->setCacheName("apicache_" . substr($this->conf["crc"], 0, 10) . ".json");
//Enable/Disable API Cache
$yahooapi->enableCache($this->conf["enableCache"]);
$api_result = $yahooapi->getWeatherData();
if (!$api_result) {
$result = $this->renderWeather(array(), false);
} else {
$result = $this->renderWeather($this->buildMarkerArray($api_result), true);
}
if ($conf['removeWrapInBaseClass'] == 1) {
return $result;
} else {
return $this->pi_wrapInBaseClass($result);
}
}
示例6: indexAction
/**
*
* @return string
*/
public function indexAction()
{
try {
$options = $this->widgetConfiguration['options'];
$apiKey = $this->widgetConfiguration['apiKey'];
if (!empty($this->widgetConfiguration['templatePathAndName'])) {
$this->view->setTemplatePathAndFilename(t3lib_div::getFileAbsFileName($this->widgetConfiguration['templatePathAndName']));
}
$flickr = new Tx_T3orgFlickrfeed_Utility_Flickr($apiKey);
if ($this->widgetConfiguration['type'] == 1 || $this->widgetConfiguration['type'] === 'tag') {
// tagSearch
$this->view->assign('result', $flickr->tagSearch($this->widgetConfiguration['tags'], $options));
if (is_array($this->widgetConfiguration['tags']) || $this->widgetConfiguration['tags'] instanceof Traversable) {
$tags = $this->widgetConfiguration['tags'];
} else {
$tags = t3lib_div::trimExplode(',', $this->widgetConfiguration['tags'], true);
}
$this->view->assign('tags', $tags);
} elseif ($this->widgetConfiguration['type'] == 2 || $this->widgetConfiguration['type'] === 'user') {
// people.getPublicPhotos
$this->view->assign('result', $flickr->userSearch($this->widgetConfiguration['user_id'], $options));
} else {
$this->view->assign('result', $flickr->groupPoolGetPhotos($this->widgetConfiguration['group_id'], $options));
}
} catch (Exception $e) {
t3lib_div::sysLog($e->getMessage(), $this->request->getControllerExtensionKey(), LOG_ERR);
$this->view->assign('error', $e->getMessage());
}
}
示例7: render
/**
* Method to render the view.
*
* @return string html content
*/
public function render()
{
ob_start();
$this->template = t3lib_div::getFileAbsFileName($this->template);
include $this->template;
$content = ob_get_contents();
ob_end_clean();
return $content;
}
示例8: initializeView
protected function initializeView(Tx_Extbase_MVC_View_ViewInterface $view)
{
if (array_key_exists('templatePath', $this->settings) && !empty($this->settings['templatePath'])) {
$rootPath = t3lib_div::getFileAbsFileName($this->settings['templatePath']);
$this->view->setTemplateRootPath($rootPath . '/Templates');
$this->view->setPartialRootPath($rootPath . '/Partials');
$this->view->setLayoutRootPath($rootPath . '/Layout');
}
}
示例9: processOutput
function processOutput()
{
if ($GLOBALS['TSFE']->type != $GLOBALS['pdf_generator2_parameters']['typeNum']) {
parent::processOutput();
} else {
$_params = array('pObj' => &$this);
require_once t3lib_div::getFileAbsFileName('EXT:pdf_generator2/class.tx_pdfgenerator2.php');
t3lib_div::callUserFunction("tx_pdfgenerator2->tslib_fe_processOutput", $_params, $this);
}
}
示例10: initializeAction
/**
* Initialize the action and get correct configuration
*
* @return void
*/
public function initializeAction()
{
$this->objects = $this->widgetConfiguration['objects'];
$this->configuration = t3lib_div::array_merge_recursive_overrule($this->configuration, (array) $this->widgetConfiguration['configuration'], TRUE);
$this->numberOfPages = (int) ceil(count($this->objects) / (int) $this->configuration['itemsPerPage']);
$this->pagesBefore = (int) $this->configuration['pagesBefore'];
$this->pagesAfter = (int) $this->configuration['pagesAfter'];
$this->lessPages = (bool) $this->configuration['lessPages'];
$this->forcedNumberOfLinks = (int) $this->configuration['forcedNumberOfLinks'];
$this->templatePath = t3lib_div::getFileAbsFileName($this->configuration['templatePath']);
}
示例11: translatePath
/**
* Translates an array of paths or single path into absolute paths/path
*
* @param mixed $path
* @return mixed
*/
public function translatePath($path)
{
if (is_array($path) == FALSE) {
return t3lib_div::getFileAbsFileName($path);
} else {
foreach ($path as $key => $subPath) {
$path[$key] = self::translatePath($subPath);
}
}
return $path;
}
示例12: _getPathReload
function _getPathReload()
{
if (($sPath = $this->_navConf("/reloadpic/")) !== FALSE) {
if (tx_ameosformidable::isRunneable($sPath)) {
$sPath = $this->callRunneable($sPath);
}
if (t3lib_div::isFirstPartOfStr($sPath, "EXT:")) {
$sPath = t3lib_div::getIndpEnv("TYPO3_SITE_URL") . str_replace(t3lib_div::getIndpEnv("TYPO3_DOCUMENT_ROOT"), "", t3lib_div::getFileAbsFileName($sPath));
}
}
return $sPath;
}
示例13: getFlagIconFileForLanguage
/**
*
* @param string $lang
* @return string
*/
public static function getFlagIconFileForLanguage($flagName)
{
$flag = null;
if (!strlen($flagName)) {
$flagName = 'unknown';
}
// same dirty trick as for #17286 in Core
if (is_file(t3lib_div::getFileAbsFileName('EXT:t3skin/images/flags/' . $flagName . '.png', FALSE))) {
// resolving extpath on its own because otherwise this might not return a relative path
$flag = $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('t3skin') . '/images/flags/' . $flagName . '.png';
}
return $flag;
}
示例14: render
/**
* Render method
*
* @return string
*/
public function render()
{
$file = t3lib_div::getFileAbsFileName($this->arguments['file']);
$directory = $this->arguments['directory'];
$evaluation = FALSE;
if (isset($this->arguments['file'])) {
$evaluation = (file_exists($file) || file_exists(PATH_site . $file)) && is_file($file);
} elseif (isset($this->arguments['directory'])) {
$evaluation = is_dir($directory) || is_dir(PATH_site . $directory);
}
if ($evaluation !== FALSE) {
return $this->renderThenChild();
}
return $this->renderElseChild();
}
示例15: render
/**
* Render the URI to the resource. The filename is used from child content.
*
* @param string $path The path and filename of the resource (relative to Public resource directory of the extension).
* @param string $extensionName Target extension name. If not set, the current extension name will be used
* @param boolean $absolute If set, an absolute URI is rendered
* @return string The URI to the resource
* @api
*/
public function render($path, $extensionName = NULL, $absolute = FALSE)
{
if ($extensionName === NULL) {
$extensionName = $this->controllerContext->getRequest()->getControllerExtensionName();
}
$uri = 'EXT:' . t3lib_div::camelCaseToLowerCaseUnderscored($extensionName) . '/Resources/Public/' . $path;
$uri = t3lib_div::getFileAbsFileName($uri);
$uri = substr($uri, strlen(PATH_site));
if (TYPO3_MODE === 'BE' && $absolute === FALSE) {
$uri = '../' . $uri;
}
if ($absolute === TRUE) {
$uri = $this->controllerContext->getRequest()->getBaseURI() . $uri;
}
return $uri;
}