Dotclear 2.26
Loading...
Searching...
No Matches
dcStoreReader Class Reference
Inheritance diagram for dcStoreReader:
HttpClient Socket

Public Member Functions

 __construct ()
 
 parse (string $url)
 
 setCacheDir (string $dir)
 
 setCacheTTL (string $str)
 
 setForce (bool $force)
 
- Public Member Functions inherited from HttpClient
 __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 (?string $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)
 
- Public Member Functions inherited from Socket
 __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 Public Member Functions

static quickParse (string $url, ?string $cache_dir=null, bool $force=false)
 
- Static Public Member Functions inherited from HttpClient
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)
 

Protected Member Functions

 getModulesXML (string $url)
 
 withCache (string $url)
 
 buildRequest ()
 
- Protected Member Functions inherited from HttpClient
 buildQueryString ($data)
 
 doRequest ()
 
 buildRequest ()
 
 outputOpen ()
 
 outputClose ()
 
 outputWrite ($content)
 
 debug (string $msg, $object=false)
 
- Protected Member Functions inherited from Socket
 iterator ()
 

Protected Attributes

 $user_agent = 'DotClear.org RepoBrowser/0.1'
 
 $validators = null
 
 $cache_dir = null
 
 $cache_file_prefix = 'dcrepo'
 
 $cache_ttl = '-1440 minutes'
 
 $cache_touch_on_fail = true
 
 $force = false
 
- Protected Attributes inherited from HttpClient
 $host
 
 $port
 
 $path
 
 $method
 
 $postdata = ''
 
 $post_charset
 
 $cookies = []
 
 $referer
 
 $mime_types
 
 $accept = ''
 
 $accept_encoding = 'gzip'
 
 $accept_language = 'en-us'
 
 $user_agent = 'Dotclear HTTP Client'
 
 $more_headers = []
 
 $timeout = 10
 
 $use_ssl = false
 
 $use_gzip = false
 
 $persist_cookies = true
 
 $persist_referers = true
 
 $debug = false
 
 $handle_redirects = true
 
 $max_redirects = 5
 
 $headers_only = false
 
 $username
 
 $password
 
 $proxy_host
 
 $proxy_port
 
 $status
 
 $status_string
 
 $headers = []
 
 $content = ''
 
 $redirect_count = 0
 
 $cookie_host = ''
 
 $output = null
 
 $output_h = null
 
- Protected Attributes inherited from Socket
 $_host
 
 $_port
 
 $_transport = ''
 
 $_timeout
 
 $_handle
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Constructor.

Bypass first argument of clearbricks HttpClient constructor.

References DC_QUERY_TIMEOUT, DC_VERSION, HttpClient\setTimeout(), and HttpClient\setUserAgent().

Member Function Documentation

◆ parse()

parse ( string  $url)

Parse modules feed.

Parameters
string$urlXML feed URL
Returns
mixed Feed content, dcStoreParser instance or false

References HttpClient\getContent(), getModulesXML(), HttpClient\getStatus(), and withCache().

◆ quickParse()

static quickParse ( string  $url,
?string  $cache_dir = null,
bool  $force = false 
)
static

Quick parse modules feed.

Parameters
string$urlXML feed URL
string$cache_dirCache directoy or null for no cache
bool$forceForce query repository
Returns
mixed Feed content, dcStoreParser instance or false

References $cache_dir, and $force.

Referenced by dcStore\check().

◆ setCacheDir()

setCacheDir ( string  $dir)

Set cache directory.

Parameters
string$dirCache directory
Returns
bool True if cache dierctory is useable

◆ setCacheTTL()

setCacheTTL ( string  $str)

Set cache TTL.

Parameters
string$strCache TTL

◆ setForce()

setForce ( bool  $force)

Set force query repository.

Parameters
bool$forceTrue to force query

References $force.

◆ getModulesXML()

getModulesXML ( string  $url)
protected

Request repository XML feed.

Parameters
string$urlXML feed URL
Returns
bool True on success, else false

References HttpClient\$host, HttpClient\$path, HttpClient\$port, HttpClient\setAuthorization(), HttpClient\setHost(), and HttpClient\useSSL().

Referenced by parse(), and withCache().

◆ withCache()

withCache ( string  $url)
protected

Get repository modules list using cache.

Parameters
string$urlXML feed URL
Returns
mixed Feed content or False on fail

References HttpClient\getContent(), getModulesXML(), and HttpClient\getStatus().

Referenced by parse().

◆ buildRequest()

buildRequest ( )
protected

Prepare query.

Returns
array Query headers

Reimplemented from HttpClient.

References HttpClient\$headers.

Field Documentation

◆ $user_agent

$user_agent = 'DotClear.org RepoBrowser/0.1'
protected

◆ $validators

$validators = null
protected

◆ $cache_dir

$cache_dir = null
protected

Referenced by quickParse().

◆ $cache_file_prefix

$cache_file_prefix = 'dcrepo'
protected

◆ $cache_ttl

$cache_ttl = '-1440 minutes'
protected

◆ $cache_touch_on_fail

$cache_touch_on_fail = true
protected

◆ $force

$force = false
protected

Referenced by quickParse(), and setForce().


The documentation for this class was generated from the following file: