PHP 클래스 PicoFeed\Parser\Parser

저자: Frederic Guillot
상속: implements PicoFeed\Parser\ParserInterface
파일 보기 프로젝트 열기: fguillot/picofeed 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$content string Feed content (XML data).
$fallback_url string Fallback url.
$namespaces array XML namespaces supported by parser.
$used_namespaces array XML namespaces used in document.

공개 메소드들

메소드 설명
__construct ( string $content, string $http_encoding = '', string $fallback_url = '' ) Constructor.
checkFeedUrl ( PicoFeed\Parser\Feed $feed ) Check if the feed url is correct.
checkItemUrl ( PicoFeed\Parser\Feed $feed, PicoFeed\Parser\Item $item ) Check if the item url is correct.
checkSiteUrl ( PicoFeed\Parser\Feed $feed ) Check if the site url is correct.
disableContentFiltering ( ) : Parser Enable the content grabber.
enableContentGrabber ( boolean $needsRuleFile = false, null | Closure $scraperCallback = null ) : Parser Enable the content grabber.
execute ( ) : PicoFeed\Parser\Feed Parse the document.
findItemDate ( SimpleXMLElement $entry, PicoFeed\Parser\Item $item, PicoFeed\Parser\Feed $feed ) Find the item date.
generateId ( ) : string Generate a unique id for an entry (hash all arguments).
getDateParser ( ) : PicoFeed\Parser\DateParser Get DateParser instance
getItemPostProcessor ( ) : PicoFeed\Processor\ItemPostProcessor Get Item Post Processor instance
isLanguageRTL ( string $language ) : boolean Return true if the given language is "Right to Left".
registerSupportedNamespaces ( SimpleXMLElement $xml ) : SimpleXMLElement Register all supported namespaces to be used within an xpath query.
setConfig ( PicoFeed\Config\Config $config ) : Parser Set config object.
setGrabberIgnoreUrls ( array $urls ) : Parser Set ignored URLs for the content grabber.
setHashAlgo ( string $algo ) : Parser Set Hash algorithm used for id generation.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( string $content, string $http_encoding = '', string $fallback_url = '' )
$content string Feed content
$http_encoding string HTTP encoding (headers)
$fallback_url string Fallback url when the feed provide relative or broken url

checkFeedUrl() 공개 메소드

Check if the feed url is correct.
public checkFeedUrl ( PicoFeed\Parser\Feed $feed )
$feed PicoFeed\Parser\Feed Feed object

checkItemUrl() 공개 메소드

Check if the item url is correct.
public checkItemUrl ( PicoFeed\Parser\Feed $feed, PicoFeed\Parser\Item $item )
$feed PicoFeed\Parser\Feed Feed object
$item PicoFeed\Parser\Item Item object

checkSiteUrl() 공개 메소드

Check if the site url is correct.
public checkSiteUrl ( PicoFeed\Parser\Feed $feed )
$feed PicoFeed\Parser\Feed Feed object

disableContentFiltering() 공개 메소드

Enable the content grabber.
public disableContentFiltering ( ) : Parser
리턴 Parser

enableContentGrabber() 공개 메소드

Enable the content grabber.
public enableContentGrabber ( boolean $needsRuleFile = false, null | Closure $scraperCallback = null ) : Parser
$needsRuleFile boolean true if only pages with rule files should be scraped
$scraperCallback null | Closure Callback function that gets called for each scraper execution
리턴 Parser

execute() 공개 메소드

Parse the document.
public execute ( ) : PicoFeed\Parser\Feed
리턴 PicoFeed\Parser\Feed

findItemDate() 공개 메소드

Find the item date.
public findItemDate ( SimpleXMLElement $entry, PicoFeed\Parser\Item $item, PicoFeed\Parser\Feed $feed )
$entry SimpleXMLElement Feed item
$item PicoFeed\Parser\Item Item object
$feed PicoFeed\Parser\Feed Feed object

generateId() 공개 메소드

Generate a unique id for an entry (hash all arguments).
public generateId ( ) : string
리턴 string

getDateParser() 공개 메소드

Get DateParser instance
public getDateParser ( ) : PicoFeed\Parser\DateParser
리턴 PicoFeed\Parser\DateParser

getItemPostProcessor() 공개 메소드

Get Item Post Processor instance
public getItemPostProcessor ( ) : PicoFeed\Processor\ItemPostProcessor
리턴 PicoFeed\Processor\ItemPostProcessor

isLanguageRTL() 공개 정적인 메소드

Return true if the given language is "Right to Left".
public static isLanguageRTL ( string $language ) : boolean
$language string Language: fr-FR, en-US
리턴 boolean

registerSupportedNamespaces() 공개 메소드

Register all supported namespaces to be used within an xpath query.
public registerSupportedNamespaces ( SimpleXMLElement $xml ) : SimpleXMLElement
$xml SimpleXMLElement Feed xml
리턴 SimpleXMLElement

setConfig() 공개 메소드

Set config object.
public setConfig ( PicoFeed\Config\Config $config ) : Parser
$config PicoFeed\Config\Config Config instance
리턴 Parser

setGrabberIgnoreUrls() 공개 메소드

Set ignored URLs for the content grabber.
public setGrabberIgnoreUrls ( array $urls ) : Parser
$urls array URLs
리턴 Parser

setHashAlgo() 공개 메소드

Set Hash algorithm used for id generation.
public setHashAlgo ( string $algo ) : Parser
$algo string Algorithm name
리턴 Parser

프로퍼티 상세

$content 보호되어 있는 프로퍼티

Feed content (XML data).
protected string $content
리턴 string

$fallback_url 보호되어 있는 프로퍼티

Fallback url.
protected string $fallback_url
리턴 string

$namespaces 보호되어 있는 프로퍼티

XML namespaces supported by parser.
protected array $namespaces
리턴 array

$used_namespaces 보호되어 있는 프로퍼티

XML namespaces used in document.
protected array $used_namespaces
리턴 array