本文整理汇总了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);
}
}
示例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
}
}
示例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;
}
示例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()));
}
}
示例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, '/');
}