![]() |
CMS
Version 3.9
|
This class provides the Fakoli CMS core. More...
Public Member Functions | |
getAdminPageRole ($identifier) | |
Get the applicable access roles for a given admin page, based on information supplied by components in their manifests. More... | |
scrollTo ($element, $offset=0) | |
Automatically scroll the page to the specified element (by DOM ID) when the page loads. More... | |
scrollToOnNextPage ($element, $offset=0) | |
Schedules a scrollTo event when the next page is loaded. More... | |
scriptOnNextPage ($s) | |
Schedules the provided script fragment to be output when the next page is loaded. More... | |
Static Public Member Functions | |
static | put ($key, $obj) |
Stores a value or object at the given key. More... | |
static | get ($key) |
Retrieves the value or object at the given key. More... | |
static | using () |
Import the datamodels, views and manifest for the specified component(s). More... | |
static | getComponents () |
Retrieve an array of all the currently enabled components, indexed by component name. More... | |
static | getComponent ($name) |
Return the component record by name. More... | |
static | componentExists ($name) |
Test whether the specified component has been registered. More... | |
static | initialComponentScan () |
Performs a complete component scan if the component table is found to be empty. More... | |
static | bootstrap () |
Bootstraps the creation of the database schema if the component table does not exist. More... | |
static | assertRole ($role, $redirect="", $message="") |
Assert that the user has one of the specified roles. More... | |
static | checkRole ($role, $msg=null) |
Check that the user has one of the specified roles. More... | |
static | isUserActive ($user) |
Checks if the given user is active. More... | |
static | getLocalIP () |
Returns the local IP address for the server. More... | |
static | usingFile () |
Uses the specified framework file(s) from the framework directory. More... | |
static | usingFeature () |
Uses the specified framework feature(s). More... | |
static | getAdminMenu () |
Builds the administration menu, combining menu items supplied by the registered components in their manifests. More... | |
static | getAdminIcons () |
Builds the admin icon map. More... | |
static | getScripts () |
Returns the HTML scripts tags for Javascript files specified by the registered components in their manifest files. More... | |
static | loadScripts () |
Load the list of JS scripts from the manifests of all registered, active components. More... | |
static | getStyles () |
Returns the HTML link tags for CSS files specified by the registered components in their manifest files. More... | |
static | loadStyles () |
Load the list of CSS files from the manifests of all registered, active components. More... | |
static | evaluateFile ($filePath) |
Evaluates a PHP include file and returns the generated content. More... | |
static | includeScript ($src) |
Utility function to pull in a specific Javascript file for the current page. More... | |
static | includeStylesheet ($src, $media="all") |
Utility function to pull in a specific CSS Stylesheet for the current page. More... | |
static | compareByWeight ($item1, $item2) |
Sorting callback function that sorts two admin menu items by their specified weights. More... | |
static | getComponentClassRoot ($name) |
Retrieves the capitalized camlCase name for the specified component. More... | |
static | sendResource ($uri, $component="") |
Sends the resource at the specified URI to the client. More... | |
static | sendFile ($resource) |
Sends the contents of the specified file to the client. More... | |
static | detectXSendFileSupport () |
Determines whether the mod_xsendfile extension is present, when running under Apache. More... | |
static | resolveResource ($resource, $component="") |
Resolves the path to a web resource based on the PHP include path. More... | |
static | loadResource ($resource, $component="") |
Load the specified resource into memory. More... | |
static | applyTemplate ($target, $templateFile, $component="") |
Format the target DataItem or JoinResult using the specified template file. More... | |
static | checkSSL () |
Checks if SSL is enabled on the current request. More... | |
static | sendPage ($sectionIdentifier, $identifier, $page_id=null) |
Serves the page with the specified section and identifier. More... | |
static | getAdminAccessRoles () |
Returns the user roles that have access to the admin section. More... | |
static | countActiveSessions () |
Returns the number of active user sessions. More... | |
static | sendAdminPage ($identifier) |
Send the admin page for the given identifier. More... | |
static | getComponentForClass ($class) |
Find the component containing the specified class. More... | |
static | end ($message="") |
Use this method to terminate execution of a script instead of using the php keywords exit() or die(). More... | |
static | JSONreturn ($object, $sendType=true, $wrap=true) |
Return a DataItem to the client in JSON format. More... | |
static | JSONerror ($error, $sendType=true) |
Return an error code to the client in JSON format, as an object with the single property 'error'. More... | |
static | notify ($message, $blocking=false, $button="OK", $onClick="null") |
Utility method to display a notification message to the user when the page has finished loading. More... | |
static | notifyOnNextPage ($message, $blocking=false, $button="OK", $onClick="null") |
Schedules a notification message to be displayed to the user at the next full page load. More... | |
static | showPendingNotification () |
Display any previously scheduled notification message. More... | |
static | showPendingScrollTo () |
Display any previously scheduled scrollto event. More... | |
static | writePendingScripts () |
Outputs any pending scripts submitted by Fakoli::scriptOnNextPage() More... | |
static | setTraceLevel ($level) |
Set the trace log level. More... | |
static | applicationTraceLevel () |
Change to the configured trace level for application code. More... | |
static | coreTraceLevel () |
Change to the configured trace level for Fakoli core code. More... | |
static | scheduledTaskTraceLevel () |
Changed to the configured trace level for scheduled task worker code. More... | |
static | errorHandler ($errLevel, $errMsg, $errFile, $errLine) |
Custom Error Handler. More... | |
static | exceptionHandler ($exception) |
Custom Exception Handler. More... | |
static | scriptName () |
Returns the name of the currently executing script. More... | |
static | detectWindowsOS () |
Returns true if running on Windows, false otherwise. More... | |
static | getServerLoad () |
Retrieves information about the Server CPU load. More... | |
static | getFileSystemInfo () |
Returns formatted summary information regarding usage of the server's filesystem. More... | |
static | shutdownHandler () |
Custom shutdown handler. More... | |
Static Public Attributes | |
static | $componentsUsed = array() |
Array of the components that have been referenced in this page request. More... | |
static | $scanning = false |
Semaphore indicating that a component scan is in progress. More... | |
static | $outputBufferLevel = 0 |
Records the level at which gzip output buffering began. More... | |
static | $rollbackBuffers = true |
Specifies whether to rollback output buffers when there is an unhandled exception. More... | |
static | $storage = array() |
General storage (volatile). See Fakoli::put and Fakoli::get. More... | |
static | $timestamp |
Microsecond Timestamp for start of request. More... | |
static | $requestStartTime |
Start of request in DateTime format. More... | |
static | $requestURI |
The initial request URI. More... | |
static | $bodyClass = "" |
Override for the body class of the page currently being served. More... | |
This class provides the Fakoli CMS core.
It contains basic utility functions used by components and modules to access the component map, and provides facilities for serving resources and pages to the client.
|
static |
Change to the configured trace level for application code.
Definition at line 1338 of file core.inc.
|
static |
Format the target DataItem or JoinResult using the specified template file.
The template file can use any of the standard Fakoli DataItem formatting tags.
mixed | $target | the DataItem or JoinResult to be formatted |
string | $templateFile | path to the template file |
string | optional component to search for the template file |
Definition at line 949 of file core.inc.
|
static |
Assert that the user has one of the specified roles.
string | $role | comma-separated list of acceptable roles |
string | $redirect | the page to which the user is to be redirected on failure |
string | $message | a message to display if redirect is empty |
Definition at line 297 of file core.inc.
|
static |
|
static |
Check that the user has one of the specified roles.
If the $msg parameter is set and the user does not have the right role, that message is thrown in an exception.
string | $role | comma-separated list of acceptable roles |
string | $msg | optional error message to be displayed on failure. If not specified, then false is returned on failure |
FakoliException |
Definition at line 338 of file core.inc.
|
static |
Checks if SSL is enabled on the current request.
|
static |
|
static |
Test whether the specified component has been registered.
string | $name | the name of the component to test |
Definition at line 246 of file core.inc.
|
static |
Change to the configured trace level for Fakoli core code.
|
static |
|
static |
|
static |
Determines whether the mod_xsendfile extension is present, when running under Apache.
This extension can significantly improve performance when serving static files from PHP scripts, such as for static file resources packaged within components, or when serving uploaded images or documents.
|
static |
Use this method to terminate execution of a script instead of using the php keywords exit() or die().
string | $message | a message or return code to emit before exiting |
Definition at line 1149 of file core.inc.
|
static |
|
static |
Evaluates a PHP include file and returns the generated content.
Files can either be specified relative the application home directory, or relative to a component using the form "<component>,<relative path>"
string | $filePath | path to the file |
FakoliException |
Definition at line 650 of file core.inc.
|
static |
Custom Exception Handler.
Exception | $exception |
Definition at line 1386 of file core.inc.
|
static |
Retrieves the value or object at the given key.
This storage is volatile and limited to the scope of the current page request. This mechanism can be used to store information that needs to be communicated between modules rendering on the same page, or for other, similar purposes.
string | $key | the key for the data to be retrieved |
Definition at line 109 of file core.inc.
|
static |
|
static |
|
static |
Builds the administration menu, combining menu items supplied by the registered components in their manifests.
Definition at line 405 of file core.inc.
Fakoli::getAdminPageRole | ( | $identifier | ) |
Get the applicable access roles for a given admin page, based on information supplied by components in their manifests.
The rules to determine access roles for an admin page are:
string | $identifier | the identifier of the admin page to be checked |
Definition at line 513 of file core.inc.
|
static |
Return the component record by name.
string | $name | the name of the component |
|
static |
|
static |
|
static |
Retrieve an array of all the currently enabled components, indexed by component name.
Definition at line 206 of file core.inc.
|
static |
Returns formatted summary information regarding usage of the server's filesystem.
Definition at line 1506 of file core.inc.
|
static |
|
static |
Returns the HTML scripts tags for Javascript files specified by the registered components in their manifest files.
Definition at line 554 of file core.inc.
|
static |
Retrieves information about the Server CPU load.
For Windows systems this is reported as percentage CPU. For Linux/UNIX systems the load information is returned in uptime format.
Note that in order for the system to return correct load values on Windows, the application pool must be running as a user with permission to read performance counters (such as NetworkService).
Definition at line 1469 of file core.inc.
|
static |
Returns the HTML link tags for CSS files specified by the registered components in their manifest files.
Definition at line 603 of file core.inc.
|
static |
|
static |
Utility function to pull in a specific CSS Stylesheet for the current page.
string | $src | the URL of the stylesheet |
string | $media | the target media for the stylesheet (defaults to 'all') |
|
static |
Performs a complete component scan if the component table is found to be empty.
Definition at line 255 of file core.inc.
|
static |
Checks if the given user is active.
Object | $user |
Definition at line 349 of file core.inc.
|
static |
|
static |
|
static |
Load the list of JS scripts from the manifests of all registered, active components.
Definition at line 581 of file core.inc.
|
static |
Load the list of CSS files from the manifests of all registered, active components.
Definition at line 625 of file core.inc.
|
static |
Utility method to display a notification message to the user when the page has finished loading.
This is useful for displaying information after a form has been saved, etc.
string | $message | the notification message to be displayed |
boolean | $blocking | (optional) true if the user has to dismiss the message manually, false (default) if it should disappear automatically |
string | $button | (optional) button text to show for blocking notifications, |
string | $onClick | (optional) Javascript code to execute when the OK button is clicked |
Definition at line 1198 of file core.inc.
|
static |
|
static |
Stores a value or object at the given key.
This storage is volatile and limited to the scope of the current page request. This mechanism can be used to store information that needs to be communicated between modules rendering on the same page, or for other, similar purposes.
string | $key | the key to store the data under |
mixed | $obj | the object or value to be stored. |
Definition at line 99 of file core.inc.
|
static |
|
static |
|
static |
Fakoli::scriptOnNextPage | ( | $s | ) |
Fakoli::scrollTo | ( | $element, | |
$offset = 0 |
|||
) |
Automatically scroll the page to the specified element (by DOM ID) when the page loads.
An optional offset can be specified to account for headers, etc.
string | $element | the DOM ID of the element to scroll to |
integer | $offset | (optional) offset in pixels |
Definition at line 1259 of file core.inc.
Fakoli::scrollToOnNextPage | ( | $element, | |
$offset = 0 |
|||
) |
Schedules a scrollTo event when the next page is loaded.
string | $element | the DOM ID of the element to scroll to |
integer | $offset | (optional) offset in pixels |
|
static |
Send the admin page for the given identifier.
string | $identifier | the admin page to be sent to the client |
Definition at line 1097 of file core.inc.
|
static |
Sends the contents of the specified file to the client.
string | $resource | the full local file path of the resource |
Definition at line 780 of file core.inc.
|
static |
Serves the page with the specified section and identifier.
string | $sectionIdentifier | the identifier of the section |
string | $identifier | the identifier of the page |
int | $page_id | numeric page identifier (deprecated) |
Definition at line 978 of file core.inc.
|
static |
Sends the resource at the specified URI to the client.
This is used by the resource.php dispatcher to send files owned by the library that may not be within the web root.
string | $uri | the URI to the resource |
string | $component | the component that owns the resource |
Definition at line 765 of file core.inc.
|
static |
|
static |
Display any previously scheduled notification message.
Definition at line 1234 of file core.inc.
|
static |
Display any previously scheduled scrollto event.
Definition at line 1288 of file core.inc.
|
static |
|
static |
Import the datamodels, views and manifest for the specified component(s).
More than one component can be specified in the call.
string | $component | the component to import |
Definition at line 116 of file core.inc.
|
static |
Uses the specified framework feature(s).
Each feature corresponds to a file in the framework directory (without the extension). Use this method to select the framework functionality you require for your page, (such as 'auto_form' or 'data_view').
|
static |
Uses the specified framework file(s) from the framework directory.
|
static |
Outputs any pending scripts submitted by Fakoli::scriptOnNextPage()
Definition at line 1313 of file core.inc.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
General storage (volatile). See Fakoli::put and Fakoli::get.
|
static |