本文整理汇总了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()));
}
示例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;
}
}
}
示例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'));