PHP Class Essence\Crawler

Afficher le fichier Open project: benjamminf/craft-embedded-assets

Protected Properties

Свойство Type Description
$_Collection Essence\Provider\Collection A collection of providers.
$_Dom Essence\Dom\Document\Factory\Native DOM parser.
$_attributes

Méthodes publiques

Méthode Description
__construct ( Collection $Collection, Native $Dom ) Constructor.
crawl ( string $html ) : array Extracts embeddable URLs from an HTML source.

Méthodes protégées

Méthode Description
_extractUrls ( Document $Document ) : array Extracts URLs from the given DOM document.
_extractUrlsFromtags ( Document $Document, string $tag, string $attribute ) : array Extracts URLs from tag attributes.
_filterUrls ( array $urls ) : array Filters the given URLs to return only the extractable ones.

Method Details

__construct() public méthode

Constructor.
public __construct ( Collection $Collection, Native $Dom )
$Collection Essence\Provider\Collection Providers collection.
$Dom Essence\Dom\Document\Factory\Native DOM parser.

_extractUrls() protected méthode

Extracts URLs from the given DOM document.
protected _extractUrls ( Document $Document ) : array
$Document Essence\Dom\Document Document.
Résultat array URLs.

_extractUrlsFromtags() protected méthode

Extracts URLs from tag attributes.
protected _extractUrlsFromtags ( Document $Document, string $tag, string $attribute ) : array
$Document Essence\Dom\Document Document.
$tag string Tag name.
$attribute string Attribute name.
Résultat array URLs.

_filterUrls() protected méthode

Filters the given URLs to return only the extractable ones.
protected _filterUrls ( array $urls ) : array
$urls array URLs to filter.
Résultat array Filtered URLs.

crawl() public méthode

Extracts embeddable URLs from an HTML source.
public crawl ( string $html ) : array
$html string The HTML source to be extracted.
Résultat array An array of extracted URLs.

Property Details

$_Collection protected_oe property

A collection of providers.
protected Collection,Essence\Provider $_Collection
Résultat Essence\Provider\Collection

$_Dom protected_oe property

DOM parser.
protected Native,Essence\Dom\Document\Factory $_Dom
Résultat Essence\Dom\Document\Factory\Native

$_attributes protected_oe property

protected $_attributes