2namespace Bitrix\Translate\IO;
20 return \preg_replace(
"#[\\\\\\/]+#".$modifier, self::DIRECTORY_SEPARATOR,
$path);
34 return \preg_replace(
"#\.\.+[\/\\\]+#i".$modifier,
'',
$path);
45 public static function isLangDir(
string $path,
bool $additionalCheck =
false): bool
48 if (\preg_match(
"#/lang/([^/]*?)(/|\$)#".$modifier,
$path, $match))
52 if (\mb_strpos(
$path,
'/lang/'.$match[1].
'/'.$check.
'/') !==
false)
59 $arr = \explode(self::DIRECTORY_SEPARATOR,
$path);
60 $langKey = \array_search(
'lang',
$arr) + 1;
62 return \array_key_exists($langKey,
$arr) &&
$arr[$langKey] <>
'';
80 $arr = \explode(self::DIRECTORY_SEPARATOR,
$path);
81 $pos = \array_search(
'lang',
$arr);
82 if ($pos !==
false && !empty(
$arr[$pos + 1]))
84 return $arr[$pos + 1];
102 return \preg_replace(
"#^(.*?/lang/)([^/]*?)(/|$)#".$modifier,
"\\1$langId\\3",
$path);
116 static $defLangs = [];
119 if (empty($defLangs))
121 $defLangs = \array_unique(\array_merge(
128 $arr = \explode(self::DIRECTORY_SEPARATOR,
$path);
129 if (\in_array(
'lang',
$arr))
131 $langKey = \array_search(
'lang',
$arr) + 1;
134 unset(
$arr[$langKey]);
136 $path = \implode(self::DIRECTORY_SEPARATOR,
$arr);
155 $arr = \explode(
'/', $pathTemp);
156 if (\in_array(
'lang',
$arr))
167 $path = \implode(
'/', $arr1);
183 $path = \rtrim(
$path, self::DIRECTORY_SEPARATOR);
191 if (!\file_exists(
$path))
193 return \mkdir(
$path, \BX_DIR_PERMISSIONS,
true);
196 return \is_dir(
$path);
206 public static function isPhpFile(
string $path,
bool $checkExistence =
false): bool
208 return $checkExistence
209 ? (\mb_substr(
$path, -4) ===
'.php') && \is_file(
$path)
210 : (\mb_substr(
$path, -4) ===
'.php');
static replaceLangId(string $path, string $langId)
static secure(string $path)
static tidy(string $path)
static isLangDir(string $path, bool $additionalCheck=false)
static extractLangId(string $path)
static isPhpFile(string $path, bool $checkExistence=false)
static checkCreatePath(string $path)
static addLangId(string $path, string $langId, ?array $langs=null)
static removeLangId(string $path, ?array $langs=null)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)