当前位置: 首页>>代码示例>>PHP>>正文


PHP File::getName方法代码示例

本文整理汇总了PHP中Bitrix\Main\IO\File::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP File::getName方法的具体用法?PHP File::getName怎么用?PHP File::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bitrix\Main\IO\File的用法示例。


在下文中一共展示了File::getName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: seoSitemapGetFilesData

function seoSitemapGetFilesData($PID, $arSitemap, $arCurrentDir, $sitemapFile)
{
    global $NS;
    $arDirList = array();
    if ($arCurrentDir['ACTIVE'] == SitemapRuntimeTable::ACTIVE) {
        $list = \CSeoUtils::getDirStructure($arSitemap['SETTINGS']['logical'] == 'Y', $arSitemap['SITE_ID'], $arCurrentDir['ITEM_PATH']);
        foreach ($list as $dir) {
            $dirKey = "/" . ltrim($dir['DATA']['ABS_PATH'], "/");
            if ($dir['TYPE'] == 'F') {
                if (!isset($arSitemap['SETTINGS']['FILE'][$dirKey]) || $arSitemap['SETTINGS']['FILE'][$dirKey] == 'Y') {
                    if (preg_match($arSitemap['SETTINGS']['FILE_MASK_REGEXP'], $dir['FILE'])) {
                        $f = new IO\File($dir['DATA']['PATH'], $arSitemap['SITE_ID']);
                        $sitemapFile->addFileEntry($f);
                        $NS['files_count']++;
                    }
                }
            } else {
                if (!isset($arSitemap['SETTINGS']['DIR'][$dirKey]) || $arSitemap['SETTINGS']['DIR'][$dirKey] == 'Y') {
                    $arDirList[] = $dirKey;
                }
            }
        }
    } else {
        $len = strlen($arCurrentDir['ITEM_PATH']);
        if (!empty($arSitemap['SETTINGS']['DIR'])) {
            foreach ($arSitemap['SETTINGS']['DIR'] as $dirKey => $checked) {
                if ($checked == 'Y') {
                    if (strncmp($arCurrentDir['ITEM_PATH'], $dirKey, $len) === 0) {
                        $arDirList[] = $dirKey;
                    }
                }
            }
        }
        if (!empty($arSitemap['SETTINGS']['FILE'])) {
            foreach ($arSitemap['SETTINGS']['FILE'] as $dirKey => $checked) {
                if ($checked == 'Y') {
                    if (strncmp($arCurrentDir['ITEM_PATH'], $dirKey, $len) === 0) {
                        $fileName = IO\Path::combine(SiteTable::getDocumentRoot($arSitemap['SITE_ID']), $dirKey);
                        if (!is_dir($fileName)) {
                            $f = new IO\File($fileName, $arSitemap['SITE_ID']);
                            if ($f->isExists() && !$f->isSystem() && preg_match($arSitemap['SETTINGS']['FILE_MASK_REGEXP'], $f->getName())) {
                                $sitemapFile->addFileEntry($f);
                                $NS['files_count']++;
                            }
                        }
                    }
                }
            }
        }
    }
    if (count($arDirList) > 0) {
        foreach ($arDirList as $dirKey) {
            $arRuntimeData = array('PID' => $PID, 'ITEM_PATH' => $dirKey, 'PROCESSED' => SitemapRuntimeTable::UNPROCESSED, 'ACTIVE' => SitemapRuntimeTable::ACTIVE, 'ITEM_TYPE' => SitemapRuntimeTable::ITEM_TYPE_DIR);
            SitemapRuntimeTable::add($arRuntimeData);
        }
    }
    SitemapRuntimeTable::update($arCurrentDir['ID'], array('PROCESSED' => SitemapRuntimeTable::PROCESSED));
}
开发者ID:Satariall,项目名称:izurit,代码行数:58,代码来源:seo_sitemap_run.php

示例2: __construct

 private function __construct(File $file)
 {
     $this->_file = $file;
     $this->_label = $file->getName();
     $savedData = $this->_getSavedData();
     foreach ($savedData as $arFix) {
         $fix = $this->createFix();
         $this->registerFix($fix);
         $fix->setUpdateData($arFix['data'])->setOriginalData($arFix['name'])->setSubject($arFix['subject'])->setProcess($arFix['process'])->setName($arFix['name'])->setDbVersion($arFix['version']);
     }
 }
开发者ID:ASDAFF,项目名称:bitrix-module-migrations,代码行数:11,代码来源:collector.php

示例3: __construct

 /**
  * FileAccessManager constructor.
  *
  * @param string $path Full path to file .access.php
  *
  * @throws InvalidPathException Invalid path to file.
  */
 public function __construct($path)
 {
     if (empty($path)) {
         throw new InvalidPathException($path);
     }
     $this->path = $path;
     $file = new File($path);
     if ($file->getName() === '.access.php') {
         $this->isFileAccess = true;
     }
 }
开发者ID:bitrix-expert,项目名称:niceaccess,代码行数:18,代码来源:AccessFileHandler.php

示例4: finish

 public function finish()
 {
     foreach ($this->partList as $key => $partName) {
         $f = new File(Path::combine($this->getDirectoryName(), $partName));
         $f->rename(str_replace($this->getPrefix(), '', $f->getPath()));
         $this->partList[$key] = $f->getName();
     }
     if ($this->isCurrentPartNotEmpty()) {
         $this->addFooter();
         $this->rename(str_replace($this->getPrefix(), '', $this->getPath()));
     }
 }
开发者ID:supertest223,项目名称:bitrixtest,代码行数:12,代码来源:sitemapruntime.php

示例5: getFileUrl

	/**
	 * Returns file relative path for URL.
	 *
	 * @param File $f File object.
	 *
	 * @return string
	 */
	protected function getFileUrl(File $f)
	{
		static $indexNames;
		if(!is_array($indexNames))
		{
			$indexNames = GetDirIndexArray();
		}

		$path = '/';
		if (substr($this->path, 0, strlen($this->documentRoot)) === $this->documentRoot)
		{
			$path = '/'.substr($f->getPath(), strlen($this->documentRoot));
		}

		$path = Path::convertLogicalToUri($path);

		$path = in_array($f->getName(), $indexNames)
			? str_replace('/'.$f->getName(), '/', $path)
			: $path;

		return '/'.ltrim($path, '/');
	}
开发者ID:nycmic,项目名称:bittest,代码行数:29,代码来源:sitemapfile.php


注:本文中的Bitrix\Main\IO\File::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。