Peta
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Wiki Class Reference

Public Member Functions

 dispatch ()
 
 indexAction ()
 
 editAction ()
 
 createPasteBinAction ()
 

Static Public Member Functions

static instance ()
 

Protected Member Functions

 _getRenderer ($extension)
 
 _render ($page)
 
 _usePasteBin ()
 
 _pathIsSafe ($path)
 
 _extractJsonFrontMatter ($source)
 
 _view ($view, $variables=array())
 
 _getTree ($dir=LIBRARY)
 
 _getAction ()
 
 _json ($data=array())
 
 _isXMLHttpRequest ()
 
 _404 ($message= 'Page not found.')
 

Protected Attributes

 $_renderers
 
 $_ignore = "/^\..*|^CVS$/"
 
 $_force_unignore = false
 
 $_action
 
 $_default_page_data
 

Member Function Documentation

Wiki::_extractJsonFrontMatter (   $source)
protected

Given a string with a page's source, attempts to locate a section of JSON Front Matter in the heading, and returns the remaining source, and an array of extracted meta data.

JSON Front Matter will only be considered when present within two lines consisting of three dashes:


{ "title": "hello world" }

Additionally, the opening and closing brackets may be dropped, and this method will still interpret the content as a hash:


"title": "hello, world",

"tags": ["hello", "world"]

Parameters
string$source
Returns
array array($remaining_source, $meta_data)
Wiki::_pathIsSafe (   $path)
protected

Given a file path, verifies if the file is safe to touch, given permissions, if it's within the library, etc.

Parameters
string$path
Returns
bool
Wiki::createPasteBinAction ( )

Handle createion of PasteBin pastes

Returns
string JSON response
Todo:
Add/improve autodetection of file format
Wiki::editAction ( )

/?a=edit If ENABLE_EDITING is true, handles file editing through the web interface.

static Wiki::instance ( )
static

Singleton

Returns
Wiki

Member Data Documentation

Wiki::$_default_page_data
protected
Initial value:
= array(
'title' => false,
'description' => 'Wikitten is a small, fast, PHP wiki.',
'tags' => array('wikitten', 'wiki'),
'page' => ''
)
Wiki::$_renderers
protected
Initial value:
= array(
'md' => 'Markdown',
'htm' => 'HTML', 'html' => 'HTML'
)

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