Properties

$db

$db : \lf\Database

Type

\lf\Database — Database Wrapper

$lf

$lf : \lf\Littlefoot

Type

\lf\Littlefoot — Littlefoot instance. = &$this;

$auth

$auth : array

Type

array — Current an array of auth information. Hoping to move to an auth object. Accessible through $lf->api()

$auth_obj

$auth_obj : \lf\auth

Type

\lf\auth — The auth object. Hoping to replace the old array system with it.

$absbase

$absbase : string

Type

string — Backward compatible. Replaced by defined 'ROOT'

$base

$base : string

Type

string — Pre-rendered data for %baseurl%

$basenoget

$basenoget : string

Type

string — Pre-rendered data for %baseurl%. With $_GET data stripped.

$relbase

$relbase : string

Type

string — Pre-rendered data for %relbase%.

$appurl

$appurl : string

Type

string — Pre-rendered data for %appurl% (per app).

$action

$action : array

Type

array — After $lf->request(), this array is filled with the chopped up URI

$vars

$vars : array

Type

array — After $lf->nav(), the URI is chopped up into the navigation elements followed by the app variables.

$select

$select : array

Type

array — Array of data for present request (template, nav_id, alias)

$admin

$admin : boolean

Type

boolean — If /admin is requested, this is set to true to fork to admin during $lf->cms()

$get

$get : array

Type

array — Copied contents of $_GET

$post

$post : array

Type

array — Copied contents of $_POST

$debug

$debug : boolean

Type

boolean — Whether or not to display errors and render execution times.

$msgg

$msgg : string

Type

string — Not sure if used.

$function_timer

$function_timer : array

Type

array — A list of execution times for each function

$settings

$settings : array<mixed,string>

Type

array<mixed,string> — array of littlefoot settings pulled from lf_settings

$head

$head : string

Type

string — just to put stuff in <head>. this prints just before </head> in DOM

$domain

$domain : string

Type

string — The domain used to access this application

$user

$user : string

Type

string — user() object

$alias

$alias : string

Type

string — Not sure if I still use this. It would be 'alias' from $select

$start

$start : float

Type

float — Start time of $lf execution.

$note

$note : string

Type

string — Old message function. Not sure if used.

$error

$error : string

Type

string — I think this is also an old message function. Not sure.

$version

$version : string

Type

string — Current littlefoot version. Pulled from ROOT.'system/version'

$app_timer

$app_timer : array

Type

array — A list of execution times for each function

$plugins

$plugins : array

Type

array — Array of plugins waiting to run array('pre_auth' => 'plugin1', 'plugin2', 'etc').

Methods

__construct()

__construct(  $db = NULL) 

Initialize Littlefoot Object

Only intended to give access to methods, don't commit to doing anything on __construct.

All standard heavy lifting shifted to run in ->cms();

$this->lf = &$this; // ensures universal availability of "$this->lf"

Parameters

$db

__destruct()

__destruct() 

printDebug()

printDebug() 

loadVersion()

loadVersion() 

cms()

cms() 

Execute as CMS

Run littlefoot as CMS with request routed to app based on lf_actions and lf_links tables

Flow

  1. pull lf_settings

  2. pull plugins

  3. default $this->lf->select values (template, title, alias=404)

  4. redirect force URL //move this to request()

  5. $this->request() // should move to __construct()

  6. $this->authenticate() // should use auth() class in cms()

  7. admin?

  8. apply acl // should be called from auth() class

  9. simplecms?or:nav(is404?)

  10. testACL?403 // should be called from auth() class (or in a separate ACL object)

  11. getcontent() //contains simplecms?mvc

  12. simplecms?%nav%

  13. echo render()

startTimer()

startTimer(  $key = 'DEFAULT') 

Parameters

$key

endTimer()

endTimer(  $key = 'DEFAULT') 

Parameters

$key

checkCSRF()

checkCSRF(  $timeout = 3600) 

Parameters

$timeout

addCSRF()

addCSRF(  $out) 

Parameters

$out

routeAdmin()

routeAdmin() 

loadSettings()

loadSettings() 

getSettings()

getSettings() 

request()

request() : boolean

Parses $_SERVER variables to environment for use within apps and $this->lf->cms\(\)

Returns

boolean —

True if admin/ requested. False if not.

route()

route(  $class,   $alias = NULL,   $return = true) 

Parameters

$class
$alias
$return

aclTest()

aclTest(  $action) 

Parameters

$action

simpleSelect()

simpleSelect(  $app = NULL) 

Parameters

$app

navSelect()

navSelect() 

getcontent()

getcontent() 

legacyStringReplace()

legacyStringReplace(  $text) 

Parameters

$text

oopbreak()

oopbreak(  $var = "OOPBREAK") 

Parameters

$var

printLogin()

printLogin() 

getLogin()

getLogin() 

getSkinBase()

getSkinBase() 

setTitle()

setTitle(  $newTitle) 

Parameters

$newTitle

getTitle()

getTitle() 

printContent()

printContent(  $key = 'content') 

Parameters

$key

render()

render(  $dir = NULL) 

Parameters

$dir

multiMVC()

multiMVC(  $default = NULL,   $section = 'content') 

Parameters

$default
$section

loadLfCSS()

loadLfCSS() 

mvc()

mvc(string  $controller, string  $ini = '', array<mixed,string>  $vars = NULL) 

Instant MVC: Routing URL request to class methods. Auto load given class name in controller/ folder as Littlefoot app.

Usage

echo $this->lf->mvc($controllerName);

Backend operation

include "controller/$controllerName.php";
$class = new $controllerName($this->lf[, $ini[, $vars]])

Parameters

string $controller

Executes $controller->$vars[0]() defined at ./controller/$controller.php

string $ini

= '' (by default) App configuration set Dashboard. Used in 'Pages' app to select the page to display on the website.

array<mixed,string> $vars

= NULL (by default) The "slash separated" list of strings in the URL after the Navigation alias. ie. domain.com/littlefoot/appNavAlias/$vars[0]/$vars[1] defaults to $this->lf->$vars generated in $this->lf->request()

extmvc()

extmvc(  $mount,   $controller_path,   $ini = '',   $vars = array('')) 

Parameters

$mount
$controller_path
$ini
$vars

megamvc()

megamvc(  $default = NULL,   $offset) 

Parameters

$default
$offset

loadapp()

loadapp(  $app,   $admin,   $ini = '',   $vars = array(''),   $custompath = NULL) 

Parameters

$app
$admin
$ini
$vars
$custompath

apploader()

apploader(  $load,   $ini = '',   $vars = NULL) 

Parameters

$load
$ini
$vars

loadPlugins()

loadPlugins() 

Initializes the plugin listener from lf_plugins table

hook_run()

hook_run(  $hook) 

Parameters

$hook

api()

api(  $var) 

Parameters

$var

adminTokenReplace()

adminTokenReplace(  $out) 

Parameters

$out

loadACL()

loadACL() 

post()

post(  $id) 

Parameters

$id