This object is the front door of the application

uses deals with database
uses the config instance
uses implements the singleton pattern
uses the database link
uses the page renderer
uses session managing
uses the request to execute
uses the current user
uses the exceptions handler
uses the errors handler
uses a request sent to database
uses the logs/errors storing object
uses serialize/unserialize XML datas
uses adds/modify crontab
uses the main Model object
package OWR
subpackage Rest

 Methods

Cloning is denied This function can NOT be overloaded

__clone() 
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::__clone()
inherited_from \OWR\Controller::__clone()

Executed when an object is unserialized We register the new object

__wakeUp() 
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::__wakeUp()
inherited_from \OWR\Controller::__wakeUp()

Adds a string to $this->_request->page

addToPage(mixed $content) 
Inherited
access public
inherited_from \OWR\Controller::addToPage()

Parameters

$content

mixed

the content to add (string if page=string, associative array if page=array)

Executes the given action This method only accepts a RestRequest object It will try to log the user in, and execute the action

execute(\OWR\REST\Request $request) : \OWR\REST\Controller

If you want to execute an action without the controller displays anything set $isInternal to true, and all errors will be logged instead

author Pierre-Alain Mignot
access public
fluent This method is part of a fluent interface and will return the same instance

Parameters

$request

mixed

Request the request to execute

Returns

Retrieves datas for displaying template

getPageDatas(string $tpl, array $datas, array $noCacheDatas) : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access public
inherited_from \OWR\Controller::getPageDatas()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$tpl

string

template name

$datas

array

&$datas retrieved datas

$noCacheDatas

array

&$noCacheDatas retrieved not cached datas

Returns

Returns a clone of the current request object

getRequest() : mixed
Inherited
author Pierre-Alain Mignot
access public
inherited_from \OWR\Controller::getRequest()

Returns

mixedclone of the current request

Instance getter This function can NOT be overloaded

iGet() : mixed
InheritedStatic
access public
static
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::iGet()
inherited_from \OWR\Controller::iGet()

Returns

mixedthe instance

Process the response of a Model call

processResponse(\OWR\Model\Response $response) 
author Pierre-Alain Mignot
access public

Parameters

$response

mixed

ModelResponse the response of the

Redirects the user to a specific page

redirect(string $url) 
Inherited
author Pierre-Alain Mignot
access public
inherited_from \OWR\Controller::redirect()

Parameters

$url

string

the url to redirect

Register function This function is called when an object is unserialized and is used to register the instance of the object This function can NOT be overloaded

register(mixed $instance) 
InheritedStatic
access public
static
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::register()
inherited_from \OWR\Controller::register()

Parameters

$instance

mixed

the instance to register

Render the page

renderPage($statusCode) : boolean
author Pierre-Alain Mignot
access public

Parameters

$statusCode

Returns

booleantrue on success

Constructor, sets : all needed instances, errors and exceptions handler,

__construct() 
access protected

Adds a template to the page to display

_buildPage(string $tpl, array $datas, boolean $return) : mixed
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::_buildPage()

Parameters

$tpl

string

the name of the tpl, without the extension

$datas

array

the datas to apply to the template

$return

boolean

returns the template instead of rendering it

Returns

mixedthe template if $return=true, else true

Removes whitespaces characters Used for javascript response that can not handle them

_cleanIndent(mixed $contents) 
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::_cleanIndent()

Parameters

$contents

mixed

&$contents the contents to clean, array or string

Returns a date in user lang from a timestamp

_getDate(int $timestamp) : string
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::_getDate()

Parameters

$timestamp

int

the timestamp to convert

Returns

stringthe date

Gets a template to display

_getPage(string $tpl, array $datas, boolean $return) : mixed
author Pierre-Alain Mignot
access protected

Parameters

$tpl

string

the name of the tpl, without the extension

$datas

array

the datas to apply to the template

$return

boolean

returns the template instead of rendering it

Returns

mixedthe template if $return=true, else true

Waits for all threads to ends up properly if any, or throw an 408 exception if we waited too long to avoid having ghost processes

_wait() 
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::_wait()

Adds a stream and redirects the user to the index Used by externals call

do_add() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_add()
fluent This method is part of a fluent interface and will return the same instance

Returns

Changes the user interface language

do_changeLang() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_changeLang()
fluent This method is part of a fluent interface and will return the same instance

Returns

Delete all news relations between the user and a specified stream/category/tag

do_clearStream() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_clearStream()
fluent This method is part of a fluent interface and will return the same instance

Returns

Deletes object(s) If no id is specified, we deletes everything related to the user but not the user himself

do_delete() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_delete()
fluent This method is part of a fluent interface and will return the same instance

Returns

Adds streams from OPML input If an url is passed, we'll try to get the remote opml file else it is an uploaded file

do_editOPML($url) : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_editOPML()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$url

the url of the OPML file, optional

Returns

Adds a stream

do_editStream(string $url, boolean $escapeNews) : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_editStream()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$url

string

the url of the stream, optionnal

$escapeNews

boolean

must-we insert the parsed news ?

Returns

Adds/Edits a category

do_editStreamGroup(string $name) : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_editStreamGroup()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$name

string

the name of the category, optionnal

Returns

Adds/Edits a tag

do_editTag() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_editTag()
fluent This method is part of a fluent interface and will return the same instance

Returns

Adds/removes tag(s) to new(s)

do_editTagsRelations() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_editTagsRelations()
fluent This method is part of a fluent interface and will return the same instance

Returns

Adds/Edits a user Must be an administrator to add or edit another user If no users are detected, we set the user automaticly as an administrator

do_editUser() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_editUser()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders the template relative to the id

do_get() : \OWR\REST\Controller
author Pierre-Alain Mignot
access protected
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders content of CLI logs file

do_getCLILogs() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getCLILogs()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders the unreads news count

do_getLastNews() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getLastNews()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders the count of unreads news for a specific id

do_getLiveNews() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getLiveNews()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders the category template for a specific id

do_getMenuPartGroup() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getMenuPartGroup()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders the stream template for a specific id

do_getMenuPartStream() 
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getMenuPartStream()

Renders the contents of the news relative to the specified id

do_getNewContents() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getNewContents()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders the details of a new for a specific id

do_getNewDetails() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getNewDetails()
fluent This method is part of a fluent interface and will return the same instance

Returns

Exports the feeds in OPML format

do_getOPML() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getOPML()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders the open search XML declaration

do_getOpenSearch() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getOpenSearch()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders the stream template related to the specified id

do_getRSS() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getRSS()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders news template from a specific stream with a specific offset

do_getStream() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getStream()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders the category template related to the specified id If no id is specified, we render the default root category

do_getStreamGroup() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getStreamGroup()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders tags from a new

do_getTags() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getTags()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders or sets the unreads news count

do_getUnread(boolean $return) : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_getUnread()
fluent This method is part of a fluent interface and will return the same instance

Parameters

$return

boolean

$return sets instead of rendering

Returns

Renders the index page

do_index() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_index()
fluent This method is part of a fluent interface and will return the same instance

Returns

Logout the user

do_logout(boolean $redirect) : \OWR\REST\Controller
author Pierre-Alain Mignot
access protected
fluent This method is part of a fluent interface and will return the same instance

Parameters

$redirect

boolean

redirects the user to the login page

Returns

Do some database cleaning/maintenance Must be an administrator

do_maintenance() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_maintenance()
fluent This method is part of a fluent interface and will return the same instance

Returns

Moves a stream into another category

do_move() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_move()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders results from a search coming from the search toolbar of your favorite browser

do_openSearch() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_openSearch()
fluent This method is part of a fluent interface and will return the same instance

Returns

Redirects to an external operator

do_redirectOperator() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_redirectOperator()
fluent This method is part of a fluent interface and will return the same instance

Returns

Tries to refresh stream(s)

do_refreshStream() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_refreshStream()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders an OPML gateway token We'll generate it if it does not exists

do_regenerateOPMLToken() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_regenerateOPMLToken()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders REST auth tokens We'll generate it if it does not exists

do_regenerateRESTAuthToken() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_regenerateRESTAuthToken()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders the stream gateway token We'll generate it if it does not exists

do_regenerateRSSToken() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_regenerateRSSToken()
fluent This method is part of a fluent interface and will return the same instance

Returns

Renames a stream/category/tag

do_rename() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_rename()
fluent This method is part of a fluent interface and will return the same instance

Returns

Returns a few statistics for current user

do_stats() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_stats()
fluent This method is part of a fluent interface and will return the same instance

Returns

Update new(s) status (read/unread)

do_upNew() : \OWR\REST\Controller
Inherited
author Pierre-Alain Mignot
access protected
inherited_from \OWR\Controller::do_upNew()
fluent This method is part of a fluent interface and will return the same instance

Returns

 Properties

 

the Config instance

$_cfg : mixed
Inherited
access protected
inherited_from \OWR\Controller::$$_cfg
 

the Cron instance

$_cron : mixed
Inherited
access protected
inherited_from \OWR\Controller::$$_cron
 

the DB instance

$_db : mixed
Inherited
access protected
inherited_from \OWR\Controller::$$_db
 

are we called by the upload frame ?

$_isFrame : boolean
Inherited
access protected
inherited_from \OWR\Controller::$$_isFrame
 

the actual minimum ttl

$_minCronTtl : int
Inherited
access protected
inherited_from \OWR\Controller::$$_minCronTtl
 

the current Request instance

$_request : mixed
Inherited
access protected
inherited_from \OWR\Controller::$$_request
 

the Session instance

$_sh : mixed
Inherited
access protected
inherited_from \OWR\Controller::$$_sh
 

the list of timezones

$_tz : array
Inherited
access protected
inherited_from \OWR\Controller::$$_tz
 

the current User instance

$_user : mixed
Inherited
access protected
inherited_from \OWR\Controller::$$_user
 

store instancied objects

$_instances : array
Inherited
access private
static
inherited_from \OWR\Singleton::$$_instances
inherited_from \OWR\Controller::$$_instances