PHP Class Habari\AtomHandler

Inheritance: extends ActionHandler
Show file Open project: habari/system

Public Properties

Property Type Description
$user

Public Methods

Method Description
__construct ( ) Constructor for AtomHandler class.
act_collection ( ) Handle incoming requests for Atom entry collections
act_comments ( $params = [] ) Handle incoming requests for the Atom entry collection for all comments
act_entry ( ) function act_entry 'index' should be 'slug'
act_entry_comments ( ) Handle incoming requests for the Atom entry collection for comments on an entry
act_introspection ( ) Handle incoming requests for the introspection document
act_rsd ( ) Handle incoming requests for RSD
act_tag_collection ( ) Handle incoming requests for the Atom entry collection for a specific tag
add_comments ( SimpleXMLElement $xml, array $comments ) : SimpleXMLElement Add comments as items in the provided xml structure
add_pagination_links ( SimpleXMLElement $xml, integer $count ) : The Adds pagination link rels to feeds
add_posts ( SimpleXMLElement $xml, array $posts ) : SimpleXMLElement Add posts as items in the provided xml structure
create_atom_wrapper ( string $alternate, string $self, string $id, DateTime $updated = null ) : SimpleXMLElement Creates a basic Atom-format XML structure
delete_entry ( string $slug ) Delete a post based on the HTTP DELETE request via Atom
get_collection ( array $params = [] ) Output a post collection based on the provided parameters.
get_comments ( array $params = [] ) Output an Atom collection of comments based on the supplied parameters.
get_entry ( string $slug ) Output the Atom entry for a specific slug
is_auth ( boolean $force = false ) : User Check if a user is authenticated for Atom editing
post_collection ( ) Accepts an Atom entry for insertion as a new post.
put_entry ( string $slug ) Updates (editing) a post entry that is sent via APP.

Protected Methods

Method Description
tidy_xml ( string $xml ) : string Use Tidy to tidy XML output for debugging by humans

Method Details

__construct() public method

Set some default formatting for Atom output.
public __construct ( )

act_collection() public method

Handle incoming requests for Atom entry collections
public act_collection ( )

act_comments() public method

Handle incoming requests for the Atom entry collection for all comments
public act_comments ( $params = [] )

act_entry() public method

function act_entry 'index' should be 'slug'
public act_entry ( )

act_entry_comments() public method

Handle incoming requests for the Atom entry collection for comments on an entry
public act_entry_comments ( )

act_introspection() public method

Handle incoming requests for the introspection document
public act_introspection ( )

act_rsd() public method

Handle incoming requests for RSD
public act_rsd ( )

act_tag_collection() public method

Handle incoming requests for the Atom entry collection for a specific tag
public act_tag_collection ( )

add_comments() public method

Add comments as items in the provided xml structure
public add_comments ( SimpleXMLElement $xml, array $comments ) : SimpleXMLElement
$xml SimpleXMLElement The document to add to
$comments array An array of Comments to add to the XML
return SimpleXMLElement The resultant XML with added comments

add_posts() public method

Add posts as items in the provided xml structure
public add_posts ( SimpleXMLElement $xml, array $posts ) : SimpleXMLElement
$xml SimpleXMLElement The document to add to
$posts array An array of Posts to add to the XML
return SimpleXMLElement The resultant XML with added posts

create_atom_wrapper() public method

Creates a basic Atom-format XML structure
public create_atom_wrapper ( string $alternate, string $self, string $id, DateTime $updated = null ) : SimpleXMLElement
$alternate string the IRI of an alternate version.
$self string The preferred URI for retrieving Atom Feed Documents representing this Atom feed.
$id string a permanent, universally unique identifier for an the feed.
$updated DateTime The most recent update in the collection to which this feed applies.
return SimpleXMLElement The requested Atom document

delete_entry() public method

Delete a post based on the HTTP DELETE request via Atom
public delete_entry ( string $slug )
$slug string The post slug to delete

get_collection() public method

Output a post collection based on the provided parameters.
public get_collection ( array $params = [] )
$params array An array of parameters as passed to Posts::get() to retrieve posts.

get_comments() public method

Output an Atom collection of comments based on the supplied parameters.
public get_comments ( array $params = [] )
$params array An array of parameters passed to Comments::get() to retrieve comments

get_entry() public method

Output the Atom entry for a specific slug
public get_entry ( string $slug )
$slug string The slug to get the entry for

is_auth() public method

Check if a user is authenticated for Atom editing
public is_auth ( boolean $force = false ) : User
$force boolean Force authorization? If so, basic HTTP_AUTH is displayed if not authed
return User The logged-in user

post_collection() public method

Accepts an Atom entry for insertion as a new post.
public post_collection ( )

put_entry() public method

Updates (editing) a post entry that is sent via APP.
public put_entry ( string $slug )
$slug string The slug of the entry to save

tidy_xml() protected method

Use Tidy to tidy XML output for debugging by humans
protected tidy_xml ( string $xml ) : string
$xml string The unformatted input XML
return string Formatted XML

Property Details

$user public property

public $user