當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Utility\VersionNumberUtility類代碼示例

本文整理匯總了PHP中TYPO3\CMS\Core\Utility\VersionNumberUtility的典型用法代碼示例。如果您正苦於以下問題:PHP VersionNumberUtility類的具體用法?PHP VersionNumberUtility怎麽用?PHP VersionNumberUtility使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了VersionNumberUtility類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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

示例2: convertDependenciesToObjects

 /**
  * Converts string dependencies to an object storage of dependencies
  *
  * @param string $dependencies
  * @return \SplObjectStorage
  */
 public function convertDependenciesToObjects($dependencies)
 {
     $dependenciesObject = new \SplObjectStorage();
     $unserializedDependencies = unserialize($dependencies);
     if (!is_array($unserializedDependencies)) {
         return $dependenciesObject;
     }
     foreach ($unserializedDependencies as $dependencyType => $dependencyValues) {
         // Dependencies might be given as empty string, e.g. conflicts => ''
         if (!is_array($dependencyValues)) {
             continue;
         }
         foreach ($dependencyValues as $dependency => $versions) {
             if ($dependencyType && $dependency) {
                 $versionNumbers = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionsStringToVersionNumbers($versions);
                 $lowest = $versionNumbers[0];
                 if (count($versionNumbers) === 2) {
                     $highest = $versionNumbers[1];
                 } else {
                     $highest = '';
                 }
                 /** @var $dependencyObject \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency */
                 $dependencyObject = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency::class);
                 $dependencyObject->setType($dependencyType);
                 $dependencyObject->setIdentifier($dependency);
                 $dependencyObject->setLowestVersion($lowest);
                 $dependencyObject->setHighestVersion($highest);
                 $dependenciesObject->attach($dependencyObject);
                 unset($dependencyObject);
             }
         }
     }
     return $dependenciesObject;
 }
開發者ID:adrolli,項目名稱:TYPO3.CMS,代碼行數:40,代碼來源:ExtensionModelUtility.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: 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

示例5: 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

示例6: 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

示例7: 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);
 }
開發者ID:sirdiego,項目名稱:importr,代碼行數:13,代碼來源:Utility.php

示例8: __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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: 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

示例14: 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

示例15: 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


注:本文中的TYPO3\CMS\Core\Utility\VersionNumberUtility類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。