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


PHP ArrayUtility::isValidPath方法代码示例

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


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

示例1: getConfigurationFromPath

 /**
  * Returns the TypoScript configuration value at a the given path.
  * Example: config.tx_myext.some_conf
  *
  * @param    string        $path      The path to the configuration value.
  * @param    int|null|bool $pageUid   The uid of the page you want the TypoScript configuration from. If "null" is given, only the static configuration is returned.
  * @param    string        $delimiter The delimiter for the path. Default is ".".
  * @return    mixed|null
  */
 public static function getConfigurationFromPath($path, $pageUid = null, $delimiter = '.')
 {
     $result = null;
     $cacheIdentifier = md5($path . (string) $pageUid);
     $cacheInstance = CacheManager::getCacheInstance(CacheManager::CACHE_MAIN);
     if ($cacheInstance) {
         if ($cacheInstance->has($cacheIdentifier)) {
             $result = $cacheInstance->get($cacheIdentifier);
         } elseif (ArrayUtility::isValidPath(self::getTypoScriptConfiguration($pageUid), $path, $delimiter)) {
             $result = ArrayUtility::getValueByPath(self::getTypoScriptConfiguration($pageUid), $path, $delimiter);
             $cacheInstance->set($cacheIdentifier, $result);
         }
     }
     return $result;
 }
开发者ID:romaincanon,项目名称:TYPO3-Site-Factory,代码行数:24,代码来源:TypoScriptUtility.php

示例2: getIdentifiersToBeExcluded

 /**
  * Gets backend layout identifiers to be excluded
  *
  * @param array $pageTSconfig
  * @return array
  */
 protected function getIdentifiersToBeExcluded(array $pageTSconfig)
 {
     $identifiersToBeExcluded = array();
     if (ArrayUtility::isValidPath($pageTSconfig, 'options./backendLayout./exclude')) {
         $identifiersToBeExcluded = GeneralUtility::trimExplode(',', ArrayUtility::getValueByPath($pageTSconfig, 'options./backendLayout./exclude'), true);
     }
     return $identifiersToBeExcluded;
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:14,代码来源:BackendLayoutView.php

示例3: getProcessSettings

 /**
  * Get the value within the settings of the duplication process, at the
  * given path.
  * If $path begins with "data:", the function will search for the
  * duplication data at the given index (string after "data:"), and return
  * the value, if found.
  *
  * @param	string	$path		The path within the settings, if none given, the full settings will be returned.
  * @param	string	$delimiter	The delimiter for path, default ".".
  * @return	mixed	The settings of the process at the given path, or the duplication data value (see function documentation).
  */
 public function getProcessSettings($path = null, $delimiter = '.')
 {
     if ($path) {
         $setting = ArrayUtility::isValidPath($this->settings, $path, $delimiter) ? ArrayUtility::getValueByPath($this->settings, $path, $delimiter) : null;
         if ($setting) {
             if (strpos($setting, 'data:') !== false) {
                 $settingDataKey = substr($setting, 5);
                 if ($this->getDuplicationData($settingDataKey)) {
                     $setting = $this->getDuplicationData($settingDataKey);
                 }
             }
         }
         return $setting;
     }
     return $this->settings;
 }
开发者ID:AgenceStratis,项目名称:TYPO3-Site-Factory,代码行数:27,代码来源:AbstractDuplicationProcess.php

示例4: isValidLocalConfigurationPath

 /**
  * Check if access / write to given path in local configuration is allowed.
  *
  * @param string $path Path to search for
  * @return boolean TRUE if access is allowed
  */
 protected function isValidLocalConfigurationPath($path)
 {
     // Early return for white listed paths
     foreach ($this->whiteListedLocalConfigurationPaths as $whiteListedPath) {
         if (Utility\GeneralUtility::isFirstPartOfStr($path, $whiteListedPath)) {
             return TRUE;
         }
     }
     return Utility\ArrayUtility::isValidPath($this->getDefaultConfiguration(), $path);
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:16,代码来源:ConfigurationManager.php

示例5: getSettings

 /**
  * @param    string $path      The path within the settings, if none given, the full settings will be returned.
  * @param    string $delimiter The delimiter for path, default ".".
  * @return mixed    The settings of the field.
  */
 public function getSettings($path = null, $delimiter = '.')
 {
     if ($path) {
         $setting = \TYPO3\CMS\Core\Utility\ArrayUtility::isValidPath($this->settings, $path, $delimiter) ? \TYPO3\CMS\Core\Utility\ArrayUtility::getValueByPath($this->settings, $path, $delimiter) : null;
         return $setting;
     }
     return $this->settings;
 }
开发者ID:romaincanon,项目名称:TYPO3-Site-Factory,代码行数:13,代码来源:AbstractField.php

示例6: isValidPathReturnsFalseIfPathDoesNotExist

 /**
  * @test
  */
 public function isValidPathReturnsFalseIfPathDoesNotExist()
 {
     $this->assertFalse(ArrayUtility::isValidPath(array('foo' => 'bar'), 'bar'));
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:7,代码来源:ArrayUtilityTest.php

示例7: callTypoScriptLibrary

 /**
  * Calls a defined TypoScript library.
  *
  * @param	array	$arguments	Array containing the request arguments.
  * @param	int		$id			The page uid.
  * @return	string	The result of the TypoScript library.
  * @throws \Exception
  */
 private function callTypoScriptLibrary($arguments, $id)
 {
     $pageConfiguration = self::getPageConfiguration($id);
     if (ArrayUtility::isValidPath($pageConfiguration, $arguments['typoScriptLib'], '.')) {
         $typoScriptLib = ArrayUtility::getValueByPath($pageConfiguration, $arguments['typoScriptLib'], '.');
         if (!array_key_exists('_typoScriptNodeValue', $typoScriptLib)) {
             throw new \Exception('The TypoScript libraty "' . $arguments['typoScriptLib'] . '" does not have a Content Object type.', 1429113764);
         }
         $result = $this->callContentObject($typoScriptLib, $arguments['arguments']);
         return $result;
     } else {
         throw new \Exception('TypoScript library "' . $arguments['typoScriptLib'] . '" was not found.', 1429113004);
     }
 }
开发者ID:AgenceStratis,项目名称:TYPO3-Site-Factory,代码行数:22,代码来源:AjaxDispatcherUtility.php

示例8: getTemplateConstantsUidAssociationString

 /**
  * Returns a string containing all the constants configuration for the
  * pages.
  *
  * @param	int		$pageUid				The page uid.
  * @param	array	$pageUidAssociation		Association of uid for the given page.
  * @return	string
  */
 private static function getTemplateConstantsUidAssociationString($pageUid, array $pageUidAssociation)
 {
     $constantsString = '';
     $pagesPaths = TypoScriptUtility::getExtensionConfigurationFromPath('constantsPaths.pagesPaths');
     if (!is_array($pagesPaths)) {
     } else {
         $constants = TypoScriptUtility::getTypoScriptConstants($pageUid);
         foreach ($pagesPaths as $path) {
             if (ArrayUtility::isValidPath($constants, $path, '.')) {
                 $pagesValues = ArrayUtility::getValueByPath($constants, $path, '.');
                 if (is_array($pagesValues)) {
                     foreach ($pagesValues as $pageName => $pageValue) {
                         if (array_key_exists($pageValue, $pageUidAssociation)) {
                             $constantsString .= $path . '.' . $pageName . ' = ' . $pageUidAssociation[$pageValue] . CRLF;
                         }
                     }
                 }
             }
         }
     }
     return $constantsString;
 }
开发者ID:AgenceStratis,项目名称:TYPO3-Site-Factory,代码行数:30,代码来源:ConstantManagerUtility.php

示例9: isValidLocalConfigurationPath

 /**
  * Check if access / write to given path in local configuration is allowed.
  *
  * @param string $path Path to search for
  * @return boolean TRUE if access is allowed
  */
 protected static function isValidLocalConfigurationPath($path)
 {
     // Early return for white listed paths
     foreach (static::$whiteListedLocalConfigurationPaths as $whiteListedPath) {
         if (\TYPO3\CMS\Core\Utility\GeneralUtility::isFirstPartOfStr($path, $whiteListedPath)) {
             return TRUE;
         }
     }
     return \TYPO3\CMS\Core\Utility\ArrayUtility::isValidPath(static::getDefaultConfiguration(), $path);
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:16,代码来源:ConfigurationManager.php


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