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


PHP StringUtility::isLastPartOfString方法代码示例

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


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

示例1: createZipFileFromExtension

 /**
  * Create a zip file from an extension
  *
  * @param array $extension
  * @return string
  */
 public function createZipFileFromExtension($extension)
 {
     $extensionPath = $this->getAbsoluteExtensionPath($extension);
     $version = $this->getExtensionVersion($extension);
     $fileName = $this->getAbsolutePath('typo3temp/' . $extension . '_' . $version . '.zip');
     $zip = new \ZipArchive();
     $zip->open($fileName, \ZipArchive::CREATE);
     $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($extensionPath));
     foreach ($iterator as $key => $value) {
         $archiveName = str_replace($extensionPath, '', $key);
         if (\TYPO3\CMS\Core\Utility\StringUtility::isLastPartOfString($key, '.')) {
             continue;
         } else {
             $zip->addFile($key, $archiveName);
         }
     }
     $zip->close();
     return $fileName;
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:25,代码来源:FileHandlingUtility.php

示例2: isLastPartOfStringReturnsThrowsExceptionWithInvalidArguments

 /**
  * @test
  * @dataProvider isLastPartOfStringReturnsInvalidArgumentDataProvider
  * @expectedException \InvalidArgumentException
  */
 public function isLastPartOfStringReturnsThrowsExceptionWithInvalidArguments($string, $part)
 {
     $this->assertFalse(\TYPO3\CMS\Core\Utility\StringUtility::isLastPartOfString($string, $part));
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:9,代码来源:StringUtilityTest.php

示例3: _parseFunc


//.........这里部分代码省略.........
                             $pregSplitMode = 'i';
                             if (isset($GLOBALS['TSFE']->config['config']['sword_noMixedCase']) && !empty($GLOBALS['TSFE']->config['config']['sword_noMixedCase'])) {
                                 $pregSplitMode = '';
                             }
                             $pieces = preg_split('/' . $GLOBALS['TSFE']->sWordRegEx . '/' . $pregSplitMode, $data, 2);
                             $newstring .= $pieces[0];
                             $match_len = strlen($data) - (strlen($pieces[0]) + strlen($pieces[1]));
                             if (strstr($pieces[0], '<') || strstr($pieces[0], '>')) {
                                 // Returns TRUE, if a '<' is closer to the string-end than '>'.
                                 // This is the case if we're INSIDE a tag (that could have been
                                 // made by makelinks...) and we must secure, that the inside of a tag is
                                 // not marked up.
                                 $inTag = strrpos($pieces[0], '<') > strrpos($pieces[0], '>');
                             }
                             // The searchword:
                             $match = substr($data, strlen($pieces[0]), $match_len);
                             if (trim($match) && strlen($match) > 1 && !$inTag) {
                                 $match = $this->wrap($match, $conf['sword']);
                             }
                             // Concatenate the Search Word again.
                             $newstring .= $match;
                             $data = $pieces[1];
                         } while ($pieces[1]);
                         $data = $newstring;
                     }
                 }
                 $contentAccum[$contentAccumP] .= $data;
             }
             $inside = 1;
         } else {
             // tags
             $len = strcspn(substr($theValue, $pointer), '>') + 1;
             $data = substr($theValue, $pointer, $len);
             if (StringUtility::isLastPartOfString($data, '/>') && !GeneralUtility::isFirstPartOfStr($data, '<link ')) {
                 $tagContent = substr($data, 1, -2);
             } else {
                 $tagContent = substr($data, 1, -1);
             }
             $tag = explode(' ', trim($tagContent), 2);
             $tag[0] = strtolower($tag[0]);
             if ($tag[0][0] === '/') {
                 $tag[0] = substr($tag[0], 1);
                 $tag['out'] = 1;
             }
             if ($conf['tags.'][$tag[0]]) {
                 $treated = 0;
                 $stripNL = 0;
                 // in-tag
                 if (!$currentTag && !$tag['out']) {
                     // $currentTag (array!) is the tag we are currently processing
                     $currentTag = $tag;
                     $contentAccumP++;
                     $treated = 1;
                     // in-out-tag: img and other empty tags
                     if (preg_match('/^(area|base|br|col|hr|img|input|meta|param)$/i', $tag[0])) {
                         $tag['out'] = 1;
                     }
                 }
                 // out-tag
                 if ($currentTag[0] == $tag[0] && $tag['out']) {
                     $theName = $conf['tags.'][$tag[0]];
                     $theConf = $conf['tags.'][$tag[0] . '.'];
                     // This flag indicates, that NL- (13-10-chars) should be stripped first and last.
                     $stripNL = $theConf['stripNL'] ? 1 : 0;
                     // This flag indicates, that this TypoTag section should NOT be included in the nonTypoTag content.
                     $breakOut = $theConf['breakoutTypoTagContent'] ? 1 : 0;
开发者ID:khanhdeux,项目名称:typo3test,代码行数:67,代码来源:ContentObjectRenderer.php

示例4: getConfiguration

 /**
  * Returns the parsed and processed configuration
  *
  * @param array $rawConfiguration Raw configuration from TypoScriptFrontendController::$config['config']
  * @return array
  */
 protected function getConfiguration(array $rawConfiguration)
 {
     $configuration = isset($rawConfiguration['cors.']) ? $rawConfiguration['cors.'] : [];
     foreach ($configuration as $option => $value) {
         // Perform stdWrap processing on all options
         if (StringUtility::isLastPartOfString($option, '.') && isset($value['stdWrap.'])) {
             unset($configuration[$option]);
             $option = substr($option, 0, -1);
             $value = $this->frontendController->cObj->stdWrap($configuration[$option], $value['stdWrap.']);
         }
         switch ($option) {
             case 'allowCredentials':
                 $value = in_array($value, ['1', 'true'], TRUE);
                 break;
             case 'allowHeaders':
             case 'allowMethods':
             case 'allowOrigin':
             case 'exposeHeaders':
                 $value = GeneralUtility::trimExplode(',', $value);
                 break;
             case 'maxAge':
                 $value = (int) $value;
                 break;
         }
         if ($option == 'allowOrigin.' && isset($value['pattern'])) {
             $option = 'allowOriginPattern';
             $value = $value['pattern'];
         }
         $configuration[$option] = $value;
     }
     return $configuration;
 }
开发者ID:pagemachine,项目名称:cors,代码行数:38,代码来源:ContentPostProcessorHook.php

示例5: applyStandardWrapToFluidPaths

 /**
  * Applies stdWrap on Fluid path definitions
  *
  * @param array $paths
  *
  * @return array
  */
 protected function applyStandardWrapToFluidPaths(array $paths)
 {
     $finalPaths = array();
     foreach ($paths as $key => $path) {
         if (StringUtility::isLastPartOfString($key, '.')) {
             if (isset($paths[substr($key, 0, -1)])) {
                 continue;
             }
             $path = $this->cObj->stdWrap('', $path);
         } elseif (isset($paths[$key . '.'])) {
             $path = $this->cObj->stdWrap($path, $paths[$key . '.']);
         }
         $finalPaths[$key] = GeneralUtility::getFileAbsFileName($path);
     }
     return $finalPaths;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:23,代码来源:FluidTemplateContentObject.php

示例6: isLastPartOfStringReturnsFalseForNotMatchingFirstPart

 /**
  * @test
  * @dataProvider isLastPartOfStringReturnsFalseForNotMatchingFirstPartDataProvider
  */
 public function isLastPartOfStringReturnsFalseForNotMatchingFirstPart($string, $part)
 {
     $this->assertFalse(\TYPO3\CMS\Core\Utility\StringUtility::isLastPartOfString($string, $part));
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:8,代码来源:class.t3lib_utility_stringTest.php


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