PHP Class UtilityController, vanilla

Inheritance: extends BaseController
Show file Open project: vanilla/vanilla

Public Properties

Property Type Description
$Form Gdn_Form
$Uses Models to automatically instantiate.

Protected Properties

Property Type Description
$specialHeaders Special-case HTTP headers that are otherwise unidentifiable as HTTP headers. Typically, HTTP headers in the $_SERVER array will be prefixed with HTTP_ or X_. These are not so we list them here for later reference.

Public Methods

Method Description
alive ( ) Signs of life.
fetchPageInfo ( $Url = '' ) Return some meta information about any page on the internet in JSON format.
getFeed ( $type = 'news', $length = 5, $feedFormat = 'normal' ) Grab a feed from the mothership.
initialize ( ) Runs before every call to this controller.
ping ( )
set ( string $UserPropertyColumn = '', string $Name = '', string $Value = '', string $TransientKey = '' ) Allows the setting of data into one of two serialized data columns on the user table: Preferences and Attributes.
setClientHour ( $ClientHour = '', string $TransientKey = '' ) Set the user's timezone (hour offset).
setHourOffset ( )
sort ( ) Set the sort order for data on an arbitrary database table.
sprites ( )
structure ( ) Update database structure based on current definitions in each app's structure.php file.
update ( ) Run a structure update on the database.
upgrade ( ) Because people try this a lot and get confused.

Private Methods

Method Description
runStructure ( boolean $captureOnly = true ) Run the database structure or /utility/structure.

Method Details

alive() public method

Signs of life.
Since: 2.0.?
public alive ( )

fetchPageInfo() public method

Return some meta information about any page on the internet in JSON format.
public fetchPageInfo ( $Url = '' )

getFeed() public method

Grab a feed from the mothership.
Since: 2.0.?
public getFeed ( $type = 'news', $length = 5, $feedFormat = 'normal' )

initialize() public method

Runs before every call to this controller.
public initialize ( )

ping() public method

public ping ( )

set() public method

The method expects "Name" & "Value" to be in the $_POST collection. This method always saves to the row of the user id performing this action (ie. $Session->UserID). The type of property column being saved should be specified in the url: i.e. /dashboard/utility/set/preference/name/value/transientKey or /dashboard/utility/set/attribute/name/value/transientKey
Since: 2.0.0
public set ( string $UserPropertyColumn = '', string $Name = '', string $Value = '', string $TransientKey = '' )
$UserPropertyColumn string The type of value being saved: preference or attribute.
$Name string The name of the property being saved.
$Value string The value of the property being saved.
$TransientKey string A unique transient key to authenticate that the user intended to perform this action.

setClientHour() public method

Set the user's timezone (hour offset).
Since: 2.0.0
public setClientHour ( $ClientHour = '', string $TransientKey = '' )
$TransientKey string Security token.

setHourOffset() public method

public setHourOffset ( )

sort() public method

Expect post values TransientKey, Target (redirect URL), Table (database table name), and TableID (an array of sort order => unique ID).
Since: 2.0.0
public sort ( )

sprites() public method

public sprites ( )

structure() public method

Update database structure based on current definitions in each app's structure.php file.
public structure ( )

update() public method

It should always be possible to call this method, even if no database tables exist yet. A working forum database should be built from scratch where none exists. Therefore, it can have no reliance on existing data calls, or they must be able to fail gracefully.
Since: 2.0.?
public update ( )

upgrade() public method

Because people try this a lot and get confused.
Since: 2.0.18
public upgrade ( )

Property Details

$Form public property

public Gdn_Form $Form
return Gdn_Form

$Uses public property

Models to automatically instantiate.
public $Uses

$specialHeaders protected static property

Special-case HTTP headers that are otherwise unidentifiable as HTTP headers. Typically, HTTP headers in the $_SERVER array will be prefixed with HTTP_ or X_. These are not so we list them here for later reference.
protected static $specialHeaders