This object is the front door of the application

uses deals with database
uses the config instance
uses manages cron settings
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 translate errors
uses the theme manager
uses the date manager
package OWR
used_by \OWR\CLI\Controller
used_by \OWR\Cron

 Methods

Cloning is denied This function can NOT be overloaded

__clone() 
Inherited
access public
author Pierre-Alain Mignot
inherited_from \OWR\Singleton::__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()

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

addToPage(mixed $content) 
access public

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 Request object It will try to log the user in, and execute the action Throws a fatal Exception if something goes really wrong

execute(\OWR\Request $request) : \OWR\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

\OWR\OWR\Request

the request to execute

Returns

Retrieves datas for displaying template

getPageDatas(string $tpl, array $datas, array $noCacheDatas) : \OWR\Controller
author Pierre-Alain Mignot
access public
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
author Pierre-Alain Mignot
access public

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()

Returns

mixedthe instance

Process the response of a Model call

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

Parameters

$response

\OWR\OWR\Model\Response

response from a model

Redirects the user to a specific page

redirect(string $url) 
author Pierre-Alain Mignot
access public

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()

Parameters

$instance

mixed

the instance to register

Render the page

renderPage(int $statusCode) : \OWR\Controller
author Pierre-Alain Mignot
access public
fluent This method is part of a fluent interface and will return the same instance

Parameters

$statusCode

int

HTTP status code, usefull for errors

Returns

Constructor, sets : all needed instances, session handler, errors and exceptions handler, starts the session, and register the user session

__construct() 
access protected

Adds a template to the page to display

_buildPage(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

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

_cleanIndent(mixed $contents) 
author Pierre-Alain Mignot
access protected

Parameters

$contents

mixed

&$contents the contents to clean, array or string

Returns a date in user lang from a timestamp

_getDate(int $timestamp) : string
author Pierre-Alain Mignot
access protected

Parameters

$timestamp

int

the timestamp to convert

Returns

stringthe date

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() 
author Pierre-Alain Mignot
access protected

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

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

Returns

Changes the user interface language

do_changeLang() : \OWR\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\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\Controller
author Pierre-Alain Mignot
access protected
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders the unreads news count

do_getLastNews() : \OWR\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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() 
author Pierre-Alain Mignot
access protected

Renders the contents of the news relative to the specified id

do_getNewContents() : \OWR\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
fluent This method is part of a fluent interface and will return the same instance

Returns

Renders tags from a new

do_getTags() : \OWR\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
fluent This method is part of a fluent interface and will return the same instance

Returns

Logout the user

do_logout(boolean $redirect) : \OWR\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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
fluent This method is part of a fluent interface and will return the same instance

Returns

Redirects to an external operator

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

Returns

Tries to refresh stream(s)

do_refreshStream() : \OWR\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
fluent This method is part of a fluent interface and will return the same instance

Returns

Renames a stream/category/tag

do_rename() : \OWR\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
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\Controller
author Pierre-Alain Mignot
access protected
fluent This method is part of a fluent interface and will return the same instance

Returns

 Properties

 

the Config instance

$_cfg : mixed
access protected
 

the Cron instance

$_cron : mixed
access protected
 

the DB instance

$_db : mixed
access protected
 

are we called by the upload frame ?

$_isFrame : boolean
access protected
 

the actual minimum ttl

$_minCronTtl : int
access protected
 

the current Request instance

$_request : mixed
access protected
 

the Session instance

$_sh : mixed
access protected
 

the list of timezones

$_tz : array
access protected
 

the current User instance

$_user : mixed
access protected
 

store instancied objects

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