PHP 클래스 samdark\sitemap\Sitemap

저자: Alexander Makarov ([email protected])
파일 보기 프로젝트 열기: samdark/sitemap 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $filePath )
addItem ( string $location, integer $lastModified = null, float $changeFrequency = null, string $priority = null ) Adds a new item to sitemap
getSitemapUrls ( string $baseUrl ) : array Returns an array of URLs written
getWrittenFilePath ( ) : array Get array of generated files
setBufferSize ( integer $number ) Sets number of URLs to be kept in memory before writing it to file.
setMaxUrls ( integer $number ) Sets maximum number of URLs to write in a single file.
setUseIndent ( boolean $value ) Sets if XML should be indented.
write ( ) Finishes writing

보호된 메소드들

메소드 설명
validateLocation ( string $location ) Takes a string and validates, if the string is a valid url

비공개 메소드들

메소드 설명
createNewFile ( ) Creates new file
finishFile ( ) Writes closing tags to current file
flush ( ) Flushes buffer into file
getCurrentFilePath ( ) : string

메소드 상세

__construct() 공개 메소드

public __construct ( string $filePath )
$filePath string path of the file to write to

addItem() 공개 메소드

Adds a new item to sitemap
public addItem ( string $location, integer $lastModified = null, float $changeFrequency = null, string $priority = null )
$location string location item URL
$lastModified integer last modification timestamp
$changeFrequency float change frequency. Use one of self:: constants here
$priority string item's priority (0.0-1.0). Default null is equal to 0.5

getSitemapUrls() 공개 메소드

Returns an array of URLs written
public getSitemapUrls ( string $baseUrl ) : array
$baseUrl string base URL of all the sitemaps written
리턴 array URLs of sitemaps written

getWrittenFilePath() 공개 메소드

Get array of generated files
public getWrittenFilePath ( ) : array
리턴 array

setBufferSize() 공개 메소드

Default is 1000.
public setBufferSize ( integer $number )
$number integer

setMaxUrls() 공개 메소드

Default is 50000.
public setMaxUrls ( integer $number )
$number integer

setUseIndent() 공개 메소드

Default is true.
public setUseIndent ( boolean $value )
$value boolean

validateLocation() 보호된 메소드

Takes a string and validates, if the string is a valid url
protected validateLocation ( string $location )
$location string

write() 공개 메소드

Finishes writing
public write ( )