![]() |
FRED™
3.0
FRED™: Framework for Rapid and Easy Development
|
Framework for Rapid and Easy Development. More...
Public Member Functions | |
| __construct ($config) | |
| Initialize the framework. More... | |
| autoload ($class_name) | |
| Autoloader. More... | |
| halt ($status=null) | |
| End the request. More... | |
| externalError ($message, $context=null) | |
| Handle an (deliberately caused) external error. More... | |
| internalError ($message, $filename=null, $line_no=null, $trace=null) | |
| Handle an internal error. More... | |
| errorHandler ($error_no, $message, $filename, $line_no) | |
| Error handler. More... | |
| exceptionHandler ($exception) | |
| Exception handler. More... | |
| shutdownFunction () | |
| Shutdown function. More... | |
| version (&$hash=null) | |
| Version without hash. More... | |
| replaceVars ($config) | |
| Replace config keys with variables. More... | |
| dump () | |
| Get a dumper. More... | |
| config ($key, $default=null) | |
| Get a value from the configuration. More... | |
| component ($name) | |
| Get a component. More... | |
| may ($name) | |
| Get a component if there is a configuration entry for it. More... | |
| has ($name) | |
| Get a component if it already exists. More... | |
| clientConfig () | |
| Public configuration. More... | |
| __call ($func_name, $params) | |
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 | |
| const | EVENT_HALT = 'fred:halt' |
| const | EVENT_EXTERNAL_ERROR = 'fred:externalError' |
| const | EVENT_SHUTDOWN = 'fred:shutdown' |
| $debug = false | |
| True for debug modus. More... | |
| $autoloadCacheKey = 'fred:autoloadCache' | |
| Session key for classnames cache. More... | |
| $autoloadMissingKey = 'fred:autoloadMissing' | |
| Session key for missing classnames cache. More... | |
| $defaultComponentNamespace = __CLASS__ | |
| Default namespace for components. If there is no class name defined for a. More... | |
| $templatePath = __DIR__ . '/../../template/' | |
| Path for the framework templates. More... | |
| $version = null | |
| Project version. More... | |
| $ignoreErrors = '/^SOAP-ERROR/' | |
| Errors to ignore on shutdown (regex). More... | |
| $stripObjectsMemoryLimit = null | |
| $stripObjectsMaxDepth = 10 | |
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 () | |
| Initialize the framework. More... | |
| saveSharedCache () | |
| stripObjects (&$item, &$objects, $level=0) | |
| Separate objects. More... | |
| stripTraceObjects (&$trace, &$objects) | |
| Separate objects from a trace. More... | |
| errorHash ($message, $filename, $line_no) | |
| releaseNotes () | |
| Add new release notes to messages and log. More... | |
| maintenance () | |
| Check for maintenance. More... | |
| defaultComponentClassName ($name) | |
| setAutoloadNamespaces ($namespaces) | |
| setAutoloadClasses ($classes) | |
| setAutoloadFiles ($classes) | |
| setTimeLimit ($value) | |
| getTimeLimit () | |
| _get ($key) | |
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 | |
| $_startTime = null | |
| Time at which the request started. More... | |
| $_initialized = false | |
| True if the framework is initialised. More... | |
| $_config = [] | |
| The configuration. More... | |
| $_internalError = false | |
| True if an internal error has (already) occured. More... | |
| $_errorHash = null | |
| Hash for the latest caught error. More... | |
| $_errorBacktrace = null | |
| Backtrace for the latest caught error. More... | |
| $_timeLimit = null | |
| Execution cut-off timestamp. More... | |
| $_autoloadNamespaces = [] | |
| Autoload namespace prefix (key) en paths (value). More... | |
| $_autoloadClasses = [] | |
| Autoload classes (key) and files (value). More... | |
| $_autoloadFiles = [] | |
| Autoload files (if not covered by the previous options). More... | |
| $_autoloadCache = [] | |
| Register direct location of class files. More... | |
| $_autoloadCacheLimit = 250 | |
| Size limit for the autoload cache. More... | |
| $_autoloadMissing = [] | |
| Register missing autoload classes (prevent double checking). More... | |
| $_sharedCacheFile = null | |
| Shared cache file. More... | |
| $_sharedCacheTime = null | |
| Creation time of the shared cache. More... | |
| $_sharedCacheTtl = 600 | |
| Time-to-live for shared cache. More... | |
| $_sharedCacheTtlSpread = 10 | |
| Random spread for TTL. More... | |
| $_components = [] | |
| Initialized components (key = component name, value = component). More... | |
| $_releaseNotesFile = __DIR__ . '/../../doc/pages/notes.php' | |
| $_releaseNotesKey = 'fred:releaseNotesTime' | |
| Session key for release notes change time. More... | |
| $_maintenanceTime = null | |
| Date and time set for maintenance (site inaccessible) in 'Y-m-d H:i:s' format. More... | |
| $_maintenanceMessage = [] | |
| Messages to show before maintenance starts. Key = seconds before start to show. More... | |
| $_maintenanceKey = 'fred:maintenanceMessage' | |
| Session key for last maintenance message. More... | |
Protected Attributes inherited from Thing | |
| $_published = [] | |
| Published properties (key = name of property, value = visibility). More... | |
Framework for Rapid and Easy Development.
The Fred object is at the core of the framework. From this object all components will be initialized. This is done in a 'lazy' manner. That is: only when the component is specificly called (through the component() function or with a magic __get()).
This object also does autoloading and error handling. The magic __call() method is mapped to the item() function of the entity component.
| __construct | ( | $config | ) |
| autoload | ( | $class_name | ) |
Autoloader.
The autoloader tries to load a class in 3 steps:
| clientConfig | ( | ) |
| component | ( | $name | ) |
| config | ( | $key, | |
$default = null |
|||
| ) |
| errorHandler | ( | $error_no, | |
| $message, | |||
| $filename, | |||
| $line_no | |||
| ) |
| exceptionHandler | ( | $exception | ) |
| externalError | ( | $message, | |
$context = null |
|||
| ) |
| halt | ( | $status = null | ) |
| has | ( | $name | ) |
| internalError | ( | $message, | |
$filename = null, |
|||
$line_no = null, |
|||
$trace = null |
|||
| ) |
| may | ( | $name | ) |
|
protected |
| replaceVars | ( | $config | ) |
| shutdownFunction | ( | ) |
Shutdown function.
If a (non catched) error is the reason for the shutdown (e.g. a timeout), then the shutdown will be processed as an internal error.
|
protected |
|
protected |
| version | ( | & | $hash = null | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| $autoloadCacheKey = 'fred:autoloadCache' |
| $autoloadMissingKey = 'fred:autoloadMissing' |
| $defaultComponentNamespace = __CLASS__ |
| $ignoreErrors = '/^SOAP-ERROR/' |
| $templatePath = __DIR__ . '/../../template/' |