本文整理汇总了PHP中TYPO3\CMS\Core\Utility\VersionNumberUtility::convertIntegerToVersionNumber方法的典型用法代码示例。如果您正苦于以下问题:PHP VersionNumberUtility::convertIntegerToVersionNumber方法的具体用法?PHP VersionNumberUtility::convertIntegerToVersionNumber怎么用?PHP VersionNumberUtility::convertIntegerToVersionNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\VersionNumberUtility
的用法示例。
在下文中一共展示了VersionNumberUtility::convertIntegerToVersionNumber方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getVersion
/**
* Get TYPO3 Version
*
* @param null $version
* @return string
*/
public static function getVersion($version = null)
{
if ($version === null) {
$version = TYPO3_version;
}
return VersionNumberUtility::convertIntegerToVersionNumber($version);
}
示例2: renderPreProcess
/**
* Insert javascript-tags for jQuery
*
* @param array $params
* @param \TYPO3\CMS\Core\Page\PageRenderer $pObj
* @return void
*/
public function renderPreProcess($params, $pObj)
{
// Get plugin-configuration
$conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_libjquery.']['settings.'];
// Generate script-tag for jquery if CDN is set
if (!empty($conf['cdn']) && array_key_exists($conf['cdn'], $this->jQueryCdnUrls)) {
// Set version-number for CDN
if (!(int) $conf['version'] || $conf['version'] === 'latest') {
$versionCdn = end($this->availableLocalJqueryVersions);
} else {
$versionCdn = VersionNumberUtility::convertVersionNumberToInteger($conf['version']);
}
// Set correct version-number for local version
if (!in_array($versionCdn, $this->availableLocalJqueryVersions)) {
$versionLocal = $this->getNearestVersion($versionCdn);
} else {
$versionLocal = $versionCdn;
}
$fallbackTag = '';
// Choose minified version if debug is disabled
$minPart = (int) $conf['debug'] ? '' : '.min';
// Deliver gzipped-version if compression is activated and client supports gzip (compression done with "gzip --best -k -S .gzip")
$gzipPart = (int) $GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['compressionLevel'] ? '.gzip' : '';
// Set path and placeholders for local file
$this->jQueryCdnUrls['local'] = $conf['localPath'] . 'jquery-%1$s%2$s.js';
// Generate tags for local or CDN (and fallback)
if ($conf['cdn'] === 'local') {
// Get local version and replace placeholders
$file = sprintf($this->jQueryCdnUrls['local'], VersionNumberUtility::convertIntegerToVersionNumber($versionLocal), $minPart) . $gzipPart;
$file = str_replace(PATH_site, '', GeneralUtility::getFileAbsFileName($file));
} else {
// Get CDN and replace placeholders
$file = sprintf($this->jQueryCdnUrls[$conf['cdn']], VersionNumberUtility::convertIntegerToVersionNumber($versionCdn), $minPart);
// Generate fallback if required
if ((int) $conf['localFallback']) {
// Get local fallback version and replace placeholders
$fileFallback = sprintf($this->jQueryCdnUrls['local'], VersionNumberUtility::convertIntegerToVersionNumber($versionLocal), $minPart) . $gzipPart;
// Get absolute path to the fallback-file
$fileFallback = str_replace(PATH_site, '', GeneralUtility::getFileAbsFileName($fileFallback));
// Wrap it in some javascript code which will enable the fallback
$fallbackTag = '<script>window.jQuery || document.write(\'<script src="' . htmlspecialchars($fileFallback) . '" type="text/javascript"><\\/script>\')</script>' . LF;
}
}
$pObj->addJsLibrary('lib_jquery', $file, 'text/javascript', FALSE, TRUE, '|' . LF . $fallbackTag . '', TRUE);
}
}
示例3: convertIntegerToVersionNumberConvertsOtherTypesAsIntegerToVersionNumber
/**
* @test
* @dataProvider invalidVersionNumberDataProvider
*/
public function convertIntegerToVersionNumberConvertsOtherTypesAsIntegerToVersionNumber($version)
{
$this->setExpectedException('\\InvalidArgumentException', '', 1334072223);
\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertIntegerToVersionNumber($version);
}