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


PHP File::getPath方法代码示例

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


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

示例1: delete

 /**
  * Deletes the file
  * with predefined path (current request uri)
  *
  * @return void
  */
 public function delete()
 {
     if ($this->cacheFile && $this->cacheFile->isExists()) {
         $cacheDirectory = $this->cacheFile->getDirectory();
         $fileSize = $this->cacheFile->getFileSize();
         if (defined("BX_COMPOSITE_DEBUG")) {
             $backupName = $this->cacheFile->getPath() . ".delete." . microtime(true);
             if ($this->checkQuota()) {
                 AddMessage2Log($backupName, "composite");
                 $backupFile = new Main\IO\File($backupName);
                 $backupFile->putContents($this->cacheFile->getContents());
                 $this->writeStatistic(0, 0, 0, 0, $fileSize);
             } else {
                 AddMessage2Log($backupName . "(quota exceeded)", "composite");
             }
         }
         $this->cacheFile->delete();
         //Try to cleanup directory
         $children = $cacheDirectory->getChildren();
         if (empty($children)) {
             $cacheDirectory->delete();
         }
         //Update total files size
         $this->writeStatistic(0, 0, 0, 0, -$fileSize);
     }
 }
开发者ID:spas-viktor,项目名称:books,代码行数:32,代码来源:statichtmlcache.php

示例2: showTab

    public static function showTab($div, $iblockElementInfo)
    {
        $engineList = array();
        if (Option::get('main', 'vendor', '') == '1c_bitrix') {
            $engineList[] = array("DIV" => "yandex_direct", "TAB" => Loc::getMessage("SEO_ADV_YANDEX_DIRECT"), "TITLE" => Loc::getMessage("SEO_ADV_YANDEX_DIRECT_TITLE"), "HANDLER" => IO\Path::combine(Application::getDocumentRoot(), BX_ROOT, "/modules/seo/admin/tab/seo_search_yandex_direct.php"));
        }
        if (count($engineList) > 0) {
            $engineTabControl = new \CAdminViewTabControl("engineTabControl", $engineList);
            ?>
<tr>
	<td colspan="2">
<?php 
            $engineTabControl->begin();
            foreach ($engineList as $engineTab) {
                $engineTabControl->beginNextTab();
                $file = new IO\File($engineTab["HANDLER"]);
                if ($file->isExists()) {
                    require $file->getPath();
                }
            }
            $engineTabControl->end();
            ?>
	</td>
</tr>
<?php 
        }
    }
开发者ID:webgksupport,项目名称:alpina,代码行数:27,代码来源:advtabengine.php

示例3: getRewriteRules

 /**
  * Returns urlrewrite array
  *
  * @param string $site Site ID.
  * @return array
  */
 private static function getRewriteRules($site)
 {
     $docRoot = rtrim(\Bitrix\Main\SiteTable::getDocumentRoot($site), '/');
     $rewriteRules = array();
     $arUrlRewrite =& $rewriteRules;
     $rewriteFile = new IO\File($docRoot . '/urlrewrite.php');
     if ($rewriteFile->isExists()) {
         include $rewriteFile->getPath();
     }
     return $rewriteRules;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:17,代码来源:adminhelper.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::getPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。