FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Alive Class Reference
Inheritance diagram for Alive:
Component Thing

Public Member Functions

 clientConfig ()
 
 register ($name)
 Register a component to be pinged. More...
 
 ping ()
 Ping the session to see its status. More...
 
 journal ($message)
 Add a message to the journal. More...
 
 journalGarbage ($force=false)
 Clean-up the journals. More...
 
 journals ($filter=null, $order=null)
 List all active journals. More...
 
 journalMessages ($name)
 All messages from a journal. More...
 
- Public Member Functions inherited from Component
 __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

 $maxSessionTime = null
 Maximum duration of a session (minutes; empty = infinite). More...
 
 $maxInactiveTime = null
 Maximum period of inactivity (minutes; empty = infinite). More...
 
 $journalPath = null
 Path for journal files (empty = do not save). More...
 
 $journalExt = '.log'
 
 $journalFormat = 'H:i:s'
 
 $journalMaxSize = 10240
 Max filesize in bytes. More...
 
 $journalTimout = 3600
 Max idle time in seconds. More...
 
 $journalGarbageChance = 100
 
- Data Fields inherited from Component
 $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 ()
 
 getInterval ()
 
 getJournalFilename ()
 
- Protected Member Functions inherited from Component
 init ()
 
 done ()
 
 getSession ()
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). 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

 $_lastAlive = null
 
 $_journalFilename = null
 
- Protected Attributes inherited from Component
 $_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...
 

Detailed Description

Definition at line 5 of file Alive.php.

Member Function Documentation

◆ clientConfig()

clientConfig ( )

Definition at line 20 of file Alive.php.

◆ getInterval()

getInterval ( )
protected

Definition at line 124 of file Alive.php.

◆ getJournalFilename()

getJournalFilename ( )
protected

Definition at line 131 of file Alive.php.

◆ init()

init ( )
protected

Definition at line 24 of file Alive.php.

◆ journal()

journal (   $message)

Add a message to the journal.

Parameters
string$messageMessage to add.

Definition at line 63 of file Alive.php.

◆ journalGarbage()

journalGarbage (   $force = false)

Clean-up the journals.

Parameters
bool$forceSet to true to force a clean-up (otherwise the journalGarbageChance is used).
Returns
int Number of active journals (null if not cleaned).

Definition at line 76 of file Alive.php.

◆ journalMessages()

journalMessages (   $name)

All messages from a journal.

Parameters
string$nameJournal name.
Returns
array Message lines.

Definition at line 118 of file Alive.php.

◆ journals()

journals (   $filter = null,
  $order = null 
)

List all active journals.

Parameters
string$filterOnly journals with this string in one of the messages.
string$orderOrder the journals by one of the properties.
Returns
array Array with 'name','time', and 'size'.

Definition at line 101 of file Alive.php.

◆ ping()

ping ( )

Ping the session to see its status.

Returns
string URL to navigate to (empty = no action required).

Definition at line 45 of file Alive.php.

◆ register()

register (   $name)

Register a component to be pinged.

Parameters
string$nameName of the component.

Definition at line 37 of file Alive.php.

Field Documentation

◆ $_journalFilename

$_journalFilename = null
protected

Definition at line 18 of file Alive.php.

◆ $_lastAlive

$_lastAlive = null
protected

Definition at line 17 of file Alive.php.

◆ $journalExt

$journalExt = '.log'

Definition at line 11 of file Alive.php.

◆ $journalFormat

$journalFormat = 'H:i:s'

Definition at line 12 of file Alive.php.

◆ $journalGarbageChance

$journalGarbageChance = 100

Definition at line 15 of file Alive.php.

◆ $journalMaxSize

$journalMaxSize = 10240

Max filesize in bytes.

Definition at line 13 of file Alive.php.

◆ $journalPath

$journalPath = null

Path for journal files (empty = do not save).

Definition at line 10 of file Alive.php.

◆ $journalTimout

$journalTimout = 3600

Max idle time in seconds.

Definition at line 14 of file Alive.php.

◆ $maxInactiveTime

$maxInactiveTime = null

Maximum period of inactivity (minutes; empty = infinite).

Definition at line 8 of file Alive.php.

◆ $maxSessionTime

$maxSessionTime = null

Maximum duration of a session (minutes; empty = infinite).

Definition at line 7 of file Alive.php.


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