当前位置: 首页>>代码示例>>PHP>>正文


PHP VersionNumberUtility::convertVersionNumberToInteger方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger方法的典型用法代码示例。如果您正苦于以下问题:PHP VersionNumberUtility::convertVersionNumberToInteger方法的具体用法?PHP VersionNumberUtility::convertVersionNumberToInteger怎么用?PHP VersionNumberUtility::convertVersionNumberToInteger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Core\Utility\VersionNumberUtility的用法示例。


在下文中一共展示了VersionNumberUtility::convertVersionNumberToInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isVersionSuitable

 /**
  * Check if current TYPO3 version is suitable for the extension
  *
  * @param string $lowestVersion
  * @param string $highestVersion
  * @return bool
  */
 protected static function isVersionSuitable($lowestVersion, $highestVersion)
 {
     $numericTypo3Version = VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version());
     $numericLowestVersion = VersionNumberUtility::convertVersionNumberToInteger($lowestVersion);
     $numericHighestVersion = VersionNumberUtility::convertVersionNumberToInteger($highestVersion);
     return MathUtility::isIntegerInRange($numericTypo3Version, $numericLowestVersion, $numericHighestVersion);
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:14,代码来源:Typo3DependencyViewHelper.php

示例2: getUpdateObjectInstance

 /**
  * Creates instance of an Update object
  *
  * @param string $className The class name
  * @param string $identifier The identifier of Update object - needed to fetch user input
  * @return AbstractUpdate Newly instantiated Update object
  */
 protected function getUpdateObjectInstance($className, $identifier)
 {
     //$userInput = $this->postValues['values'][$identifier];
     $userInput = NULL;
     $versionAsInt = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
     return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($className, $identifier, $versionAsInt, $userInput, $this);
 }
开发者ID:pschriner,项目名称:additional_sysinfo,代码行数:14,代码来源:SystemInformationController.php

示例3: migrateRecord

    /**
     * Processes the actual transformation from CSV to sys_file_references
     *
     * @param array $record
     * @return void
     */
    protected function migrateRecord(array $record)
    {
        $collections = array();
        $files = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $record['image'], TRUE);
        $descriptions = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('
', $record['imagecaption']);
        $titleText = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('
', $record['imagetitletext']);
        $i = 0;
        foreach ($files as $file) {
            if (file_exists(PATH_site . 'uploads/tx_cal/pics/' . $file)) {
                \TYPO3\CMS\Core\Utility\GeneralUtility::upload_copy_move(PATH_site . 'uploads/tx_cal/pics/' . $file, $this->targetDirectory . $file);
                $fileObject = $this->storage->getFile(self::FOLDER_ContentUploads . '/' . $file);
                //TYPO3 >= 6.2.0
                if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 6002000) {
                    $this->fileIndexRepository->add($fileObject);
                } else {
                    //TYPO3 6.1.0
                    $this->fileRepository->addToIndex($fileObject);
                }
                $dataArray = array('uid_local' => $fileObject->getUid(), 'tablenames' => $this->getRecordTableName(), 'uid_foreign' => $record['uid'], 'pid' => $record['pid'], 'fieldname' => 'image', 'sorting_foreign' => $i);
                if (isset($descriptions[$i])) {
                    $dataArray['description'] = $descriptions[$i];
                }
                if (isset($titleText[$i])) {
                    $dataArray['alternative'] = $titleText[$i];
                }
                $GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_file_reference', $dataArray);
                unlink(PATH_site . 'uploads/tx_cal/pics/' . $file);
            }
            $i++;
        }
        $this->cleanRecord($record, $i, $collections);
    }
开发者ID:ulrikkold,项目名称:cal,代码行数:40,代码来源:AbstractImagesUpdateWizard.php

示例4: init

 /**
  * Initialize all required repository and factory objects.
  *
  * @throws \RuntimeException
  */
 protected function init()
 {
     $fileadminDirectory = rtrim($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'], '/') . '/';
     /** @var $storageRepository \TYPO3\CMS\Core\Resource\StorageRepository */
     $storageRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\StorageRepository');
     $storages = $storageRepository->findAll();
     foreach ($storages as $storage) {
         $storageRecord = $storage->getStorageRecord();
         $configuration = $storage->getConfiguration();
         $isLocalDriver = $storageRecord['driver'] === 'Local';
         $isOnFileadmin = !empty($configuration['basePath']) && \TYPO3\CMS\Core\Utility\GeneralUtility::isFirstPartOfStr($configuration['basePath'], $fileadminDirectory);
         if ($isLocalDriver && $isOnFileadmin) {
             $this->storage = $storage;
             break;
         }
     }
     if (!isset($this->storage)) {
         throw new \RuntimeException('Local default storage could not be initialized - might be due to missing sys_file* tables.');
     }
     $this->fileFactory = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
     //TYPO3 >= 6.2.0
     if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 6002000) {
         $this->fileIndexRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\Index\\FileIndexRepository');
     } else {
         //TYPO3 = 6.1
         $this->fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository');
     }
     $this->targetDirectory = PATH_site . $fileadminDirectory . self::FOLDER_ContentUploads . '/';
 }
开发者ID:ulrikkold,项目名称:cal,代码行数:34,代码来源:AbstractUpdateWizard.php

示例5: constructPostProcess

 /**
  * constructPostProcess
  *
  * @param array $config
  * @param \TYPO3\CMS\Backend\Controller\BackendController $backendReference
  */
 public function constructPostProcess($config, &$backendReference)
 {
     $lastPwChange = $GLOBALS['BE_USER']->user['tx_besecurepw_lastpwchange'];
     $lastLogin = $GLOBALS['BE_USER']->user['lastlogin'];
     // get configuration of a secure password
     $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['be_secure_pw']);
     $validUntilConfiguration = trim($extConf['validUntil']);
     $validUntil = 0;
     if ($validUntilConfiguration != '') {
         $validUntil = strtotime('- ' . $validUntilConfiguration);
     }
     if ($validUntilConfiguration != '' && ($lastPwChange == 0 || $lastPwChange < $validUntil) || $lastLogin == 0) {
         // let the popup pop up :)
         $generatedLabels = array('passwordReminderWindow_title' => $GLOBALS['LANG']->sL('LLL:EXT:be_secure_pw/Resources/Private/Language/locallang_reminder.xml:passwordReminderWindow_title'), 'passwordReminderWindow_message' => $GLOBALS['LANG']->sL('LLL:EXT:be_secure_pw/Resources/Private/Language/locallang_reminder.xml:passwordReminderWindow_message'), 'passwordReminderWindow_button_changePassword' => $GLOBALS['LANG']->sL('LLL:EXT:be_secure_pw/Resources/Private/Language/locallang_reminder.xml:passwordReminderWindow_button_changePassword'), 'passwordReminderWindow_button_postpone' => $GLOBALS['LANG']->sL('LLL:EXT:be_secure_pw/Resources/Private/Language/locallang_reminder.xml:passwordReminderWindow_button_postpone'));
         // Convert labels/settings back to UTF-8 since json_encode() only works with UTF-8:
         if ($GLOBALS['LANG']->charSet !== 'utf-8') {
             $GLOBALS['LANG']->csConvObj->convArray($generatedLabels, $GLOBALS['LANG']->charSet, 'utf-8');
         }
         $labelsForJS = 'TYPO3.LLL.beSecurePw = ' . json_encode($generatedLabels) . ';';
         $backendReference->addJavascript($labelsForJS);
         $version7 = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger('7.0.0');
         $currentVersion = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
         if ($currentVersion < $version7) {
             $javaScriptFile = 'passwordreminder.js';
         } else {
             $javaScriptFile = 'passwordreminder7.js';
         }
         $backendReference->addJavascriptFile($GLOBALS['BACK_PATH'] . '../' . ExtensionManagementUtility::siteRelPath('be_secure_pw') . 'Resources/Public/JavaScript/' . $javaScriptFile);
     }
 }
开发者ID:web-vision,项目名称:be_secure_pw,代码行数:36,代码来源:BackendHook.php

示例6: __construct

 /**
  * Initializes the install service
  */
 public function __construct()
 {
     if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7000000) {
         $this->messageQueueByIdentifier = 'extbase.flashmessages.tx_extensionmanager_tools_extensionmanagerextensionmanager';
     } else {
         $this->messageQueueByIdentifier = 'core.template.flashMessages';
     }
 }
开发者ID:dcngmbh,项目名称:moox_core,代码行数:11,代码来源:InstallService.php

示例7: addConfigToParams

 /**
  * @param array $params
  * @return array
  */
 protected function addConfigToParams(array $params)
 {
     if (VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < 7000000) {
         $params['config']['init']['emptyUrlReturnValue'] = GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
     }
     $params['config']['preVars'] = array('0' => array('GETvar' => 'no_cache', 'valueMap' => array('nc' => '1'), 'noMatch' => 'bypass'), '1' => array('GETvar' => 'L', 'valueMap' => array('de' => '1', 'da' => '2'), 'noMatch' => 'bypass'));
     $params['config']['postVarSets']['_DEFAULT']['page'] = array(0 => array('GETvar' => 'page'));
     return $params;
 }
开发者ID:blumenbach,项目名称:bb-online.neu,代码行数:13,代码来源:AutoConfig.php

示例8: includeLocalLang

 public function includeLocalLang()
 {
     $llFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('cal') . 'Resources/Private/Language/locallang_plugin.xml';
     if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 4006000) {
         $localizationParser = new \TYPO3\CMS\Core\Localization\Parser\LocallangXmlParser();
         $LOCAL_LANG = $localizationParser->getParsedData($llFile, $GLOBALS['LANG']->lang);
     } else {
         $LOCAL_LANG = \TYPO3\CMS\Core\Utility\GeneralUtility::readLLfile($llFile, $GLOBALS['LANG']->lang);
     }
     return $LOCAL_LANG;
 }
开发者ID:ulrikkold,项目名称:cal,代码行数:11,代码来源:CalWizIcon.php

示例9: convertVersionNumberToInteger

 /**
  * Returns TRUE if the current TYPO3 version is compatible to the input version
  * Notice that this function compares branches, not versions
  * (4.0.1 would be > 4.0.0 although they use the same compat_version)
  *
  * @param string $verNumberStr Minimum branch number: format "4.0" NOT "4.0.0"
  * @return boolean Returns TRUE if compatible with the provided version number
  */
 public static function convertVersionNumberToInteger($verNumberStr)
 {
     $result = '';
     if (self::isEqualOrHigherSixZero()) {
         $result = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($verNumberStr);
     } elseif (class_exists('t3lib_utility_VersionNumber')) {
         $result = t3lib_utility_VersionNumber::convertVersionNumberToInteger($verNumberStr);
     } else {
         $result = t3lib_div::int_from_ver($verNumberStr);
     }
     return $result;
 }
开发者ID:rafu1987,项目名称:t3bootstrap-project,代码行数:20,代码来源:Compatibility.php

示例10: clearCache

 public static function clearCache()
 {
     if (\TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) >= 7005000) {
         $pageCache = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->getCache('cache_pages');
         $pageCache->flushByTag('cal');
     } else {
         // only use cachingFramework if initialized and configured in TYPO3
         if (\TYPO3\CMS\Core\Cache\Cache::isCachingFrameworkInitialized() && TYPO3_UseCachingFramework && is_object($GLOBALS['typo3CacheManager'])) {
             $pageCache = $GLOBALS['typo3CacheManager']->getCache('cache_pages');
             $pageCache->flushByTag('cal');
         }
     }
 }
开发者ID:ulrikkold,项目名称:cal,代码行数:13,代码来源:Functions.php

示例11: includeLocalLang

 /**
  * Reads the [extDir]/locallang.xml and returns the $LOCAL_LANG array found in that file.
  *
  * @return	The array with language labels
  */
 public function includeLocalLang()
 {
     $llFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('jfmulticontent') . 'locallang.xml';
     $version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
     if ($version < 4006000) {
         $LOCAL_LANG = \TYPO3\CMS\Core\Utility\GeneralUtility::readLLXMLfile($llFile, $GLOBALS['LANG']->lang);
     } else {
         /** @var $llxmlParser t3lib_l10n_parser_Llxml */
         $llxmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser');
         $LOCAL_LANG = $llxmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang);
     }
     return $LOCAL_LANG;
 }
开发者ID:thegass,项目名称:jfmulticontent,代码行数:18,代码来源:class.tx_jfmulticontent_pi1_wizicon.php

示例12: includeLocalLang

 /**
  * Reads the [extDir]/locallang.xml and returns the $LOCAL_LANG array found in that file.
  *
  * @return array The array with language labels
  */
 protected function includeLocalLang()
 {
     $llFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('listfeusers') . 'locallang.xml';
     $version = class_exists('\\TYPO3\\CMS\\Core\\Utility\\VersionNumberUtility') ? \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) : t3lib_div::int_from_ver(TYPO3_version);
     if ($version < 4006000) {
         $LOCAL_LANG = t3lib_div::readLLXMLfile($llFile, $GLOBALS['LANG']->lang);
     } else {
         /** @var $llxmlParser t3lib_l10n_parser_Llxml */
         $llxmlParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Parser\\LocallangXmlParser');
         $LOCAL_LANG = $llxmlParser->getParsedData($llFile, $GLOBALS['LANG']->lang);
     }
     return $LOCAL_LANG;
 }
开发者ID:snoblucha,项目名称:typo3_listfeusers,代码行数:18,代码来源:class.tx_listfeusers_pi2_wizicon.php

示例13: getNumericTYPO3versionNumber

 /**
  * Returns the current TYPO3 version number as an integer, eg. 4005000 for version 4.5
  *
  * @return int
  */
 public function getNumericTYPO3versionNumber()
 {
     if (class_exists(VersionNumberUtility)) {
         $numeric_typo3_version = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
     } else {
         if (class_exists('t3lib_utility_VersionNumber')) {
             $numeric_typo3_version = t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version);
         } else {
             $numeric_typo3_version = t3lib_div::int_from_ver(TYPO3_version);
         }
     }
     return $numeric_typo3_version;
 }
开发者ID:tiggr,项目名称:ke_troubletickets,代码行数:18,代码来源:class.tx_ketroubletickets_pi1_wizicon.php

示例14: render

 /**
  * @param string $identifier
  * @param string $size
  * @param null $overlay
  * @param string $state
  * @param string $alternativeMarkupIdentifier
  * @return string
  */
 public function render($identifier, $size = 'small', $overlay = null, $state = 'default', $alternativeMarkupIdentifier = null)
 {
     if (VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version()) < 7000000) {
         /** @var \TYPO3\CMS\Fluid\ViewHelpers\Be\Buttons\IconViewHelper $iconViewHelper */
         $iconViewHelper = $this->objectManager->get('TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\Buttons\\IconViewHelper');
         $iconViewHelper->setRenderingContext($this->renderingContext);
         return $iconViewHelper->render('', $identifier);
     } else {
         /** @var \TYPO3\CMS\Core\ViewHelpers\IconViewHelper $iconViewHelper */
         $iconViewHelper = $this->objectManager->get('TYPO3\\CMS\\Core\\ViewHelpers\\IconViewHelper');
         $iconViewHelper->setRenderingContext($this->renderingContext);
         return $iconViewHelper->render($identifier, $size, $overlay, $state, $alternativeMarkupIdentifier);
     }
 }
开发者ID:jonathanheilmann,项目名称:ext-jh_kestats_export,代码行数:22,代码来源:IconViewHelper.php

示例15: render

 /**
  * Check if TYPO3 Version is correct
  *
  * @return bool
  */
 public function render()
 {
     // settings
     $_EXTKEY = 'powermail';
     require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('powermail') . 'ext_emconf.php';
     $versionString = $EM_CONF['powermail']['constraints']['depends']['typo3'];
     $versions = explode('-', $versionString);
     $powermailVersion = VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version);
     $isAboveMinVersion = $powermailVersion > VersionNumberUtility::convertVersionNumberToInteger($versions[0]);
     $isBelowMaxVersion = $powermailVersion < VersionNumberUtility::convertVersionNumberToInteger($versions[1]);
     if ($isAboveMinVersion && $isBelowMaxVersion) {
         return TRUE;
     }
     return FALSE;
 }
开发者ID:advOpk,项目名称:pwm,代码行数:20,代码来源:T3VersionViewHelper.php


注:本文中的TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。