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


PHP Environment::pathComponents方法代码示例

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


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

示例1: pathComponentsResource

 /**
  * @param string... $path0_
  *
  * @return \Components\Io_Path
  */
 public static function pathComponentsResource($path0_)
 {
     if (null === self::$m_pathComponents) {
         self::$m_pathComponents = Environment::pathComponents();
     }
     return new Io_Path(self::$m_pathComponents . '/' . implode('/', func_get_args()));
 }
开发者ID:evalcodenet,项目名称:net.evalcode.components.io,代码行数:12,代码来源:io.php

示例2: load

 private static function load()
 {
     $locale = self::$m_locale->name();
     $language = self::$m_locale->languageName();
     if (false === isset(self::$m_loaded[$locale])) {
         if (self::$m_cache[$locale] = Cache::get(self::CACHE_KEY . "/{$locale}")) {
             return self::$m_loaded[$locale] = true;
         }
         self::$m_cache[$locale] = [];
         if (false === isset(self::$m_loaded[$language])) {
             if (self::$m_cache[$language] = Cache::get(self::CACHE_KEY . "/{$language}")) {
                 return self::$m_loaded[$language] = true;
             }
             self::$m_cache[$language] = [];
             $directoryIterator = new \RecursiveDirectoryIterator(Environment::pathComponents(), \RecursiveDirectoryIterator::SKIP_DOTS | \RecursiveDirectoryIterator::FOLLOW_SYMLINKS);
             $iterator = new \RegexIterator(new \RecursiveIteratorIterator($directoryIterator), '/\\/([a-zA-Z0-9]+)\\/resource\\/i18n\\/translation\\/((?>[a-zA-Z0-9\\/]+\\/)|(?R))*([_a-zA-Z]+)\\.json$/', \RegexIterator::GET_MATCH);
             foreach ($iterator as $path => $match) {
                 self::loadFile($path, $match[3]);
             }
             foreach (self::$m_cache as $loc => $translations) {
                 $l = I18n_Locale::forName($loc);
                 $ll = $l->languageName();
                 if ($loc !== $ll && isset(self::$m_cache[$ll])) {
                     self::$m_cache[$loc] = array_merge(self::$m_cache[$ll], self::$m_cache[$loc]);
                 }
                 Cache::set(self::CACHE_KEY . "/{$loc}", self::$m_cache[$loc]);
                 self::$m_loaded[$loc] = true;
             }
             self::$m_loaded[$language] = true;
         }
         if (false === isset(self::$m_loaded[$locale]) && isset(self::$m_loaded[$language])) {
             self::$m_cache[$locale] = array_merge(self::$m_cache[$language], self::$m_cache[$locale]);
             Cache::set(self::CACHE_KEY . "/{$locale}", self::$m_cache[$locale]);
             self::$m_loaded[$locale] = true;
         }
     }
 }
开发者ID:evalcodenet,项目名称:net.evalcode.components.i18n,代码行数:37,代码来源:i18n.php

示例3:

<?php

namespace Components;

/* @var $this Test_Runner */
if (null === $this->getTestRootPath()) {
    $this->setTestRootPath(Environment::pathComponents());
}
if (null === $this->getBuildPath()) {
    $this->setBuildPath(Environment::pathApplication() . '/build');
}
$this->addListener(new Test_Listener_Emma($this->getTestRootPath(), $this->getBuildPath() . '/emma.xml'));
开发者ID:evalcodenet,项目名称:net.evalcode.components.test,代码行数:12,代码来源:default.php


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