當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Path::getName方法代碼示例

本文整理匯總了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 . ']}';
 }
開發者ID:andy-profi,項目名稱:bxApiDocs,代碼行數:28,代碼來源:asset.php

示例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;
 }
開發者ID:DarneoStudio,項目名稱:bitrix,代碼行數:43,代碼來源:urlrewriter.php

示例3: getName

 public function getName()
 {
     return Path::getName($this->path);
 }
開發者ID:rasuldev,項目名稱:torino,代碼行數:4,代碼來源:filesystementry.php


注:本文中的Bitrix\Main\IO\Path::getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。