PHP Class Essence\Essence

显示文件 Open project: benjamminf/craft-embedded-assets Class Usage Examples

Protected Properties

Property Type Description
$_Container Essence\Di\Container DI container.
$_Crawler Essence\Crawler URL crawler.
$_Extractor Essence\Extractor Information extractor.
$_Http Http HTTP client.
$_Replacer Essence\Replacer URL replacer.

Public Methods

Method Description
__construct ( array $configuration = [] ) Constructor.
container ( ) : Container Returns the internal DI container.
crawl ( string $source, string $base = '' ) : array Crawls the given source for extractable URLs, optionnaly resolving them relatively to a base one.
crawlUrl ( $url )
extract ( $url, array $options = [] )
extractAll ( array $urls, array $options = [] )
replace ( $text, $template = null, array $options = [] )

Method Details

__construct() public method

Constructor.
public __construct ( array $configuration = [] )
$configuration array Dependency injection configuration.

container() public method

Returns the internal DI container.
See also: https://github.com/felixgirault/essence/issues/80
See also: https://github.com/felixgirault/essence/issues/82
public container ( ) : Container
return Essence\Di\Container Container.

crawl() public method

Crawls the given source for extractable URLs, optionnaly resolving them relatively to a base one.
See also: Essence\Crawler::crawl()
See also: Essence\Utility\Url::resolve()
public crawl ( string $source, string $base = '' ) : array
$source string HTML source.
$base string Base URL.
return array URLs.

crawlUrl() public method

See also: crawl()
public crawlUrl ( $url )

extract() public method

See also: Essence\Extractor::extract()
public extract ( $url, array $options = [] )
$options array

extractAll() public method

See also: Essence\Extractor::extractAll()
public extractAll ( array $urls, array $options = [] )
$urls array
$options array

replace() public method

See also: Essence\Replacer::replace()
public replace ( $text, $template = null, array $options = [] )
$options array

Property Details

$_Container protected_oe property

DI container.
protected Container,Essence\Di $_Container
return Essence\Di\Container

$_Crawler protected_oe property

URL crawler.
protected Essence\Crawler $_Crawler
return Essence\Crawler

$_Extractor protected_oe property

Information extractor.
protected Essence\Extractor $_Extractor
return Essence\Extractor

$_Http protected_oe property

HTTP client.
protected Http $_Http
return Http

$_Replacer protected_oe property

URL replacer.
protected Essence\Replacer $_Replacer
return Essence\Replacer