Index extends Base
Generates index file from sitemap files list
Table of Contents
Constants
- APPEND = 1
- ENTRY_TPL = '<sitemap><loc>%s</loc><lastmod>%s</lastmod></sitemap>'
- ENTRY_TPL_SEARCH = '<url><loc>%s</loc>'
- FILE_EXT = '.xml'
- FILE_FOOTER = '</sitemapindex>'
- FILE_HEADER = '<sitemapindex 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
- appendIndexEntry() : mixed
- close() : mixed
- Closes the file.
- createIndex() : mixed
- 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
= '<sitemap><loc>%s</loc><lastmod>%s</lastmod></sitemap>'
ENTRY_TPL_SEARCH
public
mixed
ENTRY_TPL_SEARCH
= '<url><loc>%s</loc>'
FILE_EXT
public
mixed
FILE_EXT
= '.xml'
FILE_FOOTER
public
mixed
FILE_FOOTER
= '</sitemapindex>'
FILE_HEADER
public
mixed
FILE_HEADER
= '<sitemapindex 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.
addFileEntry()
Adds new file entry to the current sitemap
public
addFileEntry(File $f) : void
Parameters
- $f : File
-
File to add.
Tags
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.
appendIndexEntry()
public
appendIndexEntry(mixed $file) : mixed
Parameters
- $file : mixed
close()
Closes the file.
public
close() : mixed
Tags
createIndex()
public
createIndex(array<string|int, mixed> $arIndex) : mixed
Parameters
- $arIndex : array<string|int, mixed>
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
getDirectory()
public
getDirectory() : mixed
getDirectoryName()
public
getDirectoryName() : 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
getName()
public
getName() : mixed
getNameList()
Returns list of file parts.
public
getNameList() : array<string|int, mixed>
Return values
array<string|int, mixed>getPath()
public
getPath() : mixed
getPathDirectory()
Divide path to directory and filemname
public
getPathDirectory() : string
Return values
stringgetPermissions()
public
getPermissions() : mixed
getPhysicalPath()
public
getPhysicalPath() : mixed
getSiteRoot()
Returns sitemap site root
public
getSiteRoot() : mixed|string
Return values
mixed|stringgetSize()
Returns the file size.
public
getSize() : float|int
Tags
Return values
float|intgetUrl()
Returns sitemap file URL
public
getUrl() : string
Return values
stringisCurrentPartNotEmpty()
Returns if current sitemap part contains something besides header.
public
isCurrentPartNotEmpty() : bool
Return values
boolisDirectory()
public
isDirectory() : mixed
isExists()
public
isExists() : mixed
isFile()
public
isFile() : mixed
isFileExists()
public
static isFileExists(mixed $path) : mixed
Parameters
- $path : mixed
isLink()
public
isLink() : mixed
isNotEmpty()
Returns if the whole sitemap is empty (not only current part).
public
isNotEmpty() : bool
Return values
boolisReadable()
public
isReadable() : mixed
isSystem()
public
isSystem() : 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
Return values
resourceparse()
Parses sitemap file
public
parse() : bool|CDataXML
Tags
Return values
bool|CDataXMLputContents()
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
stringrename()
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
Return values
intsplit()
Creates next sitemap file part. Returns new part file name.
public
split() : string