本文整理汇总了PHP中Bitrix\Main\IO\Path::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Path::getName方法的具体用法?PHP Path::getName怎么用?PHP Path::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Main\IO\Path
的用法示例。
在下文中一共展示了Path::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateSourceMap
/**
* Generates source map content
* @param $fileName
* @param $content
* @return string
*/
private static function generateSourceMap($fileName, $content)
{
$files = self::getFilesInfo($content);
$sections = "";
foreach ($files as $file) {
if (!isset($file["map"]) || strlen($file["map"]) < 1) {
continue;
}
$filePath = Main\Loader::getDocumentRoot() . $file["map"];
if (file_exists($filePath) && ($content = file_get_contents($filePath)) !== false) {
if ($sections !== "") {
$sections .= ",";
}
$dirPath = IO\Path::getDirectory($file["source"]);
$sourceName = IO\Path::getName($file["source"]);
$minName = IO\Path::getName($file["min"]);
$sourceMap = str_replace(array($sourceName, $minName), array($dirPath . "/" . $sourceName, $dirPath . "/" . $minName), $content);
$sections .= '{"offset": { "line": ' . $file["line"] . ', "column": 0 }, "map": ' . $sourceMap . '}';
}
}
return '{"version":3, "file":"' . $fileName . '", "sections": [' . $sections . ']}';
}
示例2: checkPath
private static function checkPath($path)
{
static $searchMasksCache = false;
if (is_array($searchMasksCache)) {
$arExc = $searchMasksCache["exc"];
$arInc = $searchMasksCache["inc"];
} else {
$arExc = array();
$arInc = array();
$inc = Config\Option::get("main", "urlrewrite_include_mask", "*.php");
$inc = str_replace("'", "\\'", str_replace("*", ".*?", str_replace("?", ".", str_replace(".", "\\.", str_replace("\\", "/", $inc)))));
$arIncTmp = explode(";", $inc);
foreach ($arIncTmp as $preg_mask) {
if (strlen(trim($preg_mask)) > 0) {
$arInc[] = "'^" . trim($preg_mask) . "\$'";
}
}
$exc = Config\Option::get("main", "urlrewrite_exclude_mask", "/bitrix/*;");
$exc = str_replace("'", "\\'", str_replace("*", ".*?", str_replace("?", ".", str_replace(".", "\\.", str_replace("\\", "/", $exc)))));
$arExcTmp = explode(";", $exc);
foreach ($arExcTmp as $preg_mask) {
if (strlen(trim($preg_mask)) > 0) {
$arExc[] = "'^" . trim($preg_mask) . "\$'";
}
}
$searchMasksCache = array("exc" => $arExc, "inc" => $arInc);
}
$file = IO\Path::getName($path);
if (substr($file, 0, 1) === ".") {
return 0;
}
foreach ($arExc as $preg_mask) {
if (preg_match($preg_mask, $path)) {
return false;
}
}
foreach ($arInc as $preg_mask) {
if (preg_match($preg_mask, $path)) {
return true;
}
}
return false;
}
示例3: getName
public function getName()
{
return Path::getName($this->path);
}