Bitrix API

Base extends File

Base class for sitemap file

Table of Contents

Constants

APPEND  = 1
ENTRY_TPL  = '<url><loc>%s</loc><lastmod>%s</lastmod></url>'
ENTRY_TPL_SEARCH  = '<url><loc>%s</loc>'
FILE_EXT  = '.xml'
FILE_FOOTER  = '</urlset>'
FILE_HEADER  = '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'
FILE_PART_SUFFIX  = '.part'
MAX_SIZE  = 5000000
REWRITE  = 0
XML_HEADER  = '<?xml version="1.0" encoding="UTF-8"?>'
XPATH_URL  = '/urlset/url'

Methods

__construct()  : mixed
addEntry()  : void
Adds new entry to the current sitemap file
addFileEntry()  : void
Adds new file entry to the current sitemap
addFooter()  : void
Adds footer to the current sitemap part
addHeader()  : void
Adds header to the current sitemap file.
addIBlockEntry()  : void
Adds new IBlock entry to the current sitemap
appendEntry()  : void
Appends new entry to the existing and finished sitemap file
appendIBlockEntry()  : void
Appends new IBlock entry to the existing finished sitemap
close()  : mixed
Closes the file.
delete()  : mixed
deleteFile()  : mixed
getContents()  : mixed
getContentType()  : mixed
getCreationTime()  : mixed
getDirectory()  : mixed
getDirectoryName()  : mixed
getExtension()  : mixed
getFileContents()  : mixed
getFileSize()  : mixed
getLastAccessTime()  : mixed
getModificationTime()  : mixed
getName()  : mixed
getNameList()  : array<string|int, mixed>
Returns list of file parts.
getPath()  : mixed
getPathDirectory()  : string
Divide path to directory and filemname
getPermissions()  : mixed
getPhysicalPath()  : mixed
getSiteRoot()  : mixed|string
Returns sitemap site root
getSize()  : float|int
Returns the file size.
getUrl()  : string
Returns sitemap file URL
isCurrentPartNotEmpty()  : bool
Returns if current sitemap part contains something besides header.
isDirectory()  : mixed
isExists()  : mixed
isFile()  : mixed
isFileExists()  : mixed
isLink()  : mixed
isNotEmpty()  : bool
Returns if the whole sitemap is empty (not only current part).
isReadable()  : mixed
isSystem()  : mixed
isWritable()  : mixed
markWritable()  : mixed
open()  : resource
Opens the file and returns the file pointer.
parse()  : bool|CDataXML
Parses sitemap file
putContents()  : mixed
putFileContents()  : mixed
readFile()  : mixed
removeEntry()  : string
Searches and removes entry to the existing and finished sitemap file
rename()  : mixed
seek()  : int
Seeks on the file pointer from the beginning (SEEK_SET only).
split()  : string
Creates next sitemap file part. Returns new part file name.

Constants

APPEND

public mixed APPEND = 1

ENTRY_TPL

public mixed ENTRY_TPL = '<url><loc>%s</loc><lastmod>%s</lastmod></url>'

ENTRY_TPL_SEARCH

public mixed ENTRY_TPL_SEARCH = '<url><loc>%s</loc>'

FILE_EXT

public mixed FILE_EXT = '.xml'
public mixed FILE_FOOTER = '</urlset>'

FILE_HEADER

public mixed FILE_HEADER = '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'

FILE_PART_SUFFIX

public mixed FILE_PART_SUFFIX = '.part'

MAX_SIZE

public mixed MAX_SIZE = 5000000

REWRITE

public mixed REWRITE = 0

XML_HEADER

public mixed XML_HEADER = '<?xml version="1.0" encoding="UTF-8"?>'

XPATH_URL

public mixed XPATH_URL = '/urlset/url'

Methods

__construct()

public __construct(mixed $fileName, mixed $settings) : mixed
Parameters
$fileName : mixed
$settings : mixed

addEntry()

Adds new entry to the current sitemap file

public addEntry(array<string|int, mixed> $entry) : void

Entry array keys XML_LOC - loc field value XML_LASTMOD - lastmod field value

Parameters
$entry : array<string|int, mixed>

Entry array.

addFooter()

Adds footer to the current sitemap part

public addFooter() : void

addHeader()

Adds header to the current sitemap file.

public addHeader() : void

addIBlockEntry()

Adds new IBlock entry to the current sitemap

public addIBlockEntry(string $url, string $modifiedDate) : void
Parameters
$url : string

IBlock entry URL.

$modifiedDate : string

IBlock entry modify timestamp.

appendEntry()

Appends new entry to the existing and finished sitemap file

public appendEntry(array<string|int, mixed> $entry) : void

Entry array keys XML_LOC - loc field value XML_LASTMOD - lastmod field value

Parameters
$entry : array<string|int, mixed>

Entry array.

appendIBlockEntry()

Appends new IBlock entry to the existing finished sitemap

public appendIBlockEntry(string $url, string $modifiedDate) : void
Parameters
$url : string

IBlock entry URL.

$modifiedDate : string

IBlock entry modify timestamp.

delete()

public delete() : mixed

deleteFile()

public static deleteFile(mixed $path) : mixed
Parameters
$path : mixed

getContents()

public getContents() : mixed

getContentType()

public getContentType() : mixed

getCreationTime()

public getCreationTime() : mixed

getExtension()

public getExtension() : mixed

getFileContents()

public static getFileContents(mixed $path) : mixed
Parameters
$path : mixed

getFileSize()

public getFileSize() : mixed

Use getSize() instead

getLastAccessTime()

public getLastAccessTime() : mixed

getModificationTime()

public getModificationTime() : mixed

getNameList()

Returns list of file parts.

public getNameList() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPathDirectory()

Divide path to directory and filemname

public getPathDirectory() : string
Return values
string

getPermissions()

public getPermissions() : mixed

getSiteRoot()

Returns sitemap site root

public getSiteRoot() : mixed|string
Return values
mixed|string

getUrl()

Returns sitemap file URL

public getUrl() : string
Return values
string

isCurrentPartNotEmpty()

Returns if current sitemap part contains something besides header.

public isCurrentPartNotEmpty() : bool
Return values
bool

isExists()

public isExists() : mixed

isFileExists()

public static isFileExists(mixed $path) : mixed
Parameters
$path : mixed

isNotEmpty()

Returns if the whole sitemap is empty (not only current part).

public isNotEmpty() : bool
Return values
bool

isReadable()

public isReadable() : mixed

isWritable()

public isWritable() : mixed

markWritable()

public markWritable() : mixed

open()

Opens the file and returns the file pointer.

public open(string $mode) : resource
Parameters
$mode : string
Tags
throws
FileOpenException
Return values
resource

putContents()

public putContents(mixed $data[, mixed $flags = self::REWRITE ]) : mixed
Parameters
$data : mixed
$flags : mixed = self::REWRITE

putFileContents()

public static putFileContents(mixed $path, mixed $data[, mixed $flags = self::REWRITE ]) : mixed
Parameters
$path : mixed
$data : mixed
$flags : mixed = self::REWRITE

readFile()

public readFile() : mixed

removeEntry()

Searches and removes entry to the existing and finished sitemap file

public removeEntry(string $url) : string

Entry array keys XML_LOC - loc field value XML_LASTMOD - lastmod field value

Parameters
$url : string

Entry URL.

Return values
string

rename()

public rename(mixed $newPath) : mixed
Parameters
$newPath : mixed

seek()

Seeks on the file pointer from the beginning (SEEK_SET only).

public seek(int|float $position) : int
Parameters
$position : int|float
Tags
throws
FileNotOpenedException
Return values
int

split()

Creates next sitemap file part. Returns new part file name.

public split() : string
Return values
string

        
On this page

Search results