66 $cacheKey =
'w_' . $path;
67 if (isset(self::$pathFormatCache[$cacheKey])) {
68 self::$pathFormatStats[
'windows_hits']++;
69 return self::$pathFormatCache[$cacheKey];
72 self::$pathFormatStats[
'windows_misses']++;
74 $result = str_replace(
'/',
'\\', $path);
76 if (count(self::$pathFormatCache) < self::$pathFormatCacheMaxSize) {
77 self::$pathFormatCache[$cacheKey] =
$result;
79 $removeCount = (int)(self::$pathFormatCacheMaxSize * 0.1);
80 self::$pathFormatCache = array_slice(self::$pathFormatCache, $removeCount,
null,
true);
81 self::$pathFormatCache[$cacheKey] =
$result;
104 $cacheKey =
'u_' . $path;
105 if (isset(self::$pathFormatCache[$cacheKey])) {
106 self::$pathFormatStats[
'unix_hits']++;
107 return self::$pathFormatCache[$cacheKey];
110 self::$pathFormatStats[
'unix_misses']++;
112 $result = str_replace(
'\\',
'/', $path);
114 if (count(self::$pathFormatCache) < self::$pathFormatCacheMaxSize) {
115 self::$pathFormatCache[$cacheKey] =
$result;
117 $removeCount = (int)(self::$pathFormatCacheMaxSize * 0.1);
118 self::$pathFormatCache = array_slice(self::$pathFormatCache, $removeCount,
null,
true);
119 self::$pathFormatCache[$cacheKey] =
$result;