Feed Reader.
More...
|
| __construct () |
|
| parse (string $url) |
|
| setCacheDir (string $dir) |
|
| setCacheTTL (string $str) |
|
| __construct ($host, int $port=80, ?int $timeout=null) |
|
| get (string $path, $data=false) |
|
| post (string $path, $data, ?string $charset=null) |
|
| getStatus () |
|
| getContent () |
|
| getHeaders () |
|
| getHeader ($header) |
|
| getCookies () |
|
| getRequestURL () |
|
| setHost (string $host, int $port=80) |
|
| setProxy ($host, int $port=8080) |
|
| setTimeout (int $timeout) |
|
| setUserAgent (string $user_agent) |
|
| setAuthorization (?string $username, ?string $password) |
|
| setMoreHeader (string $header) |
|
| voidMoreHeaders () |
|
| setCookies (array $cookies) |
|
| useSSL (bool $flag) |
|
| useGzip (bool $flag) |
|
| setPersistCookies (bool $flag) |
|
| setPersistReferers (bool $flag) |
|
| setHandleRedirects (bool $flag) |
|
| setMaxRedirects (int $num) |
|
| setHeadersOnly (bool $flag) |
|
| setDebug (bool $flag) |
|
| setOutput (?string $out) |
|
| __construct (string $host, int $port, int $timeout=10) |
|
| __destruct () |
|
| host (?string $host=null) |
|
| port (?int $port=null) |
|
| timeout (?int $timeout=null) |
|
| setBlocking (bool $block) |
|
| open () |
|
| close () |
|
| write ($data) |
|
| flush () |
|
| isOpen () |
|
|
static | quickParse (string $url, ?string $cache_dir=null) |
|
static | quickGet (string $url, ?string $output=null) |
|
static | quickPost (string $url, array $data, ?string $output=null) |
|
static | initClient (string $url, string &$path) |
|
static | readURL (string $url, bool &$ssl, string &$host, int &$port, string &$path, string &$user, string &$pass) |
|
Feed Reader.
Features:
- Reads RSS 1.0 (rdf), RSS 2.0 and Atom feeds.
- HTTP cache negociation support
- Cache TTL.
◆ __construct()
Constructor.
Does nothing. See parse()
method for URL handling.
◆ parse()
◆ quickParse()
static quickParse |
( |
string |
$url, |
|
|
?string |
$cache_dir = null |
|
) |
| |
|
static |
Quick Parse
This static method returns a new feedParser
instance for given URL. If a $cache_dir is specified, cache will be activated.
- Parameters
-
string | $url | Feed URL |
string | $cache_dir | Cache directory |
- Returns
- feedParser|false
References $cache_dir.
Referenced by Widgets\feed(), and ModuleImportFeed\process().
◆ setCacheDir()
setCacheDir |
( |
string |
$dir | ) |
|
Set Cache Directory
Returns true and sets $cache_dir
property if $dir is a writable directory. Otherwise, returns false.
- Parameters
-
string | $dir | Cache directory |
- Returns
- bool
◆ setCacheTTL()
setCacheTTL |
( |
string |
$str | ) |
|
Set Cache TTL
Sets cache TTL. $str is a interval readable by strtotime (-3 minutes, -2 hours, etc.)
- Parameters
-
◆ getFeed()
◆ withCache()
◆ buildRequest()
Build request
Adds HTTP cache headers to common headers.
{Prepare RequestPrepares HTTP request and returns an array of HTTP headers.
- Returns
- array
}
Reimplemented from netHttp.
References netHttp\$headers.
◆ $user_agent
$user_agent = 'Clearbricks Feed Reader/0.2' |
|
protected |
◆ $timeout
◆ $validators
◆ $cache_dir
◆ $cache_file_prefix
$cache_file_prefix = 'cbfeed' |
|
protected |
◆ $cache_ttl
$cache_ttl = '-30 minutes' |
|
protected |
The documentation for this class was generated from the following file: