FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Component Class Reference

Basic component class. More...

Inheritance diagram for Component:
Thing Alive Cache Client Controller View Db Migrate Debug Def Encrypt Entity Event External File Front Health Check Hint Html Local Location Lock Log Mail Message Minify Parallel Pdf Proxy Request Router Security Check Server Services Socket Stats Storage Token Trans User Authenticator Files Vars Worker Workflow

Public Member Functions

 __construct ($fred, $config=null)
 
 __destruct ()
 
 clientConfig ()
 Public configuration. More...
 
 config ($key, $default=null)
 Retrieve a config value. More...
 
 ping ()
 Ping function. More...
 
 filemtime ($filename)
 Filemtime with session cache. More...
 
 component ($name)
 Get a component (local or default). More...
 
 components (... $names)
 Get multiple components in an array. More...
 
- Public Member Functions inherited from Thing
 propertyExists ($property)
 Check if a property exists (public or published). More...
 
 constants ($prefix=null)
 Return all constants. More...
 
 get ($key)
 Get one or more properties. More...
 
 set ($key, $value=null)
 Set one or more properties. More...
 
 __get ($key)
 
 __set ($key, $value)
 

Data Fields

 $filemtimeTtl = 0
 
- Data Fields inherited from Thing
const HIDDEN = 0
 Property is hidden. More...
 
const READABLE = 1
 Property is readable. More...
 
const WRITEABLE = 2
 Property is writeable. More...
 
const READWRITE = 3
 Property is readable and writeable. More...
 

Protected Member Functions

 init ()
 
 done ()
 
 getSession ()
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). More...
 
 alias ($alias, $property, $object=null)
 Define an alias for a property (of another object). More...
 
 configure ($config)
 Configure the object. More...
 
 _get ($key)
 Default getter if no specific setter is defined, and the property is also not published (readable). More...
 
 _set ($key, $value)
 Default setter if no specific setter is defined, and the property is also not published (writeable). More...
 

Protected Attributes

 $_fred = null
 
 $_config = null
 
 $_name = null
 
 $_components = []
 Local components (key = component name, value = component). More...
 
 $_session = null
 
- Protected Attributes inherited from Thing
 $_published = []
 Published properties (key = name of property, value = visibility). More...
 
 $_aliases = []
 Alias properties (key = alias, value = [object,property]). More...
 

Detailed Description

Basic component class.

Definition at line 8 of file Component.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $fred,
  $config = null 
)

Reimplemented in Debug.

Definition at line 19 of file Component.php.

◆ __destruct()

__destruct ( )

Definition at line 26 of file Component.php.

Member Function Documentation

◆ clientConfig()

clientConfig ( )

Public configuration.

Returns
array Public configuration for this component in key => value pairs.

Reimplemented in Controller, Security, Local, Alive, Csrf, Check, and Hint.

Definition at line 40 of file Component.php.

◆ component()

component (   $name)

Get a component (local or default).

Parameters
string$nameName of the component.
Returns
Rsi\Fred\Component

Definition at line 81 of file Component.php.

◆ components()

components (   $names)

Get multiple components in an array.

Parameters
string$names,...Names of the components.
Returns
array Key = component name, value = component.

Definition at line 90 of file Component.php.

◆ config()

config (   $key,
  $default = null 
)

Retrieve a config value.

Parameters
string | array$keyKey to look at. An array indicates a nested key. If the array is ['foo' => ['bar' => 'acme']], then the nested key for the 'acme' value will be ['foo','bar'].
mixed$defaultDefault value if the key does not exist.
Returns
mixed Found value, or default value if the key does not exist.

Definition at line 53 of file Component.php.

◆ done()

done ( )
protected

Reimplemented in Router.

Definition at line 34 of file Component.php.

◆ filemtime()

filemtime (   $filename)

Filemtime with session cache.

Parameters
string$filenameFile to get modification time for.
Returns
int Last modification time. False if file does not exists.

Definition at line 66 of file Component.php.

◆ getSession()

getSession ( )
protected

Definition at line 96 of file Component.php.

◆ init()

init ( )
protected

Reimplemented in Trans, Controller, Html, Mail, Cache, Log, Request, Alive, View, Stats, Local, Location, Honeypot, and Subnet.

Definition at line 30 of file Component.php.

◆ ping()

ping ( )

Ping function.

Reimplemented in Alive, and Lock.

Definition at line 59 of file Component.php.

Field Documentation

◆ $_components

$_components = []
protected

Local components (key = component name, value = component).

Definition at line 16 of file Component.php.

◆ $_config

$_config = null
protected

Definition at line 13 of file Component.php.

◆ $_fred

$_fred = null
protected

Definition at line 12 of file Component.php.

◆ $_name

$_name = null
protected

Definition at line 14 of file Component.php.

◆ $_session

$_session = null
protected

Definition at line 17 of file Component.php.

◆ $filemtimeTtl

$filemtimeTtl = 0

Definition at line 10 of file Component.php.


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