Cherrycake
ExamplesGithub
version 2.x alpha
version 2.x alpha
  • Introduction
  • Status
  • Changelog
  • Migration
  • Architecture
    • Basics
    • Modules
    • Classes
    • Lifecycle
      • Deep lifecycle
    • Performance
    • Security
    • Patterns
      • Files structure
    • Items
    • Server requirements
  • Guide
    • Getting started
      • Skeleton start
      • Docker start
    • Modules guide
    • Classes guide
    • Actions guide
      • Complex actions
      • Variable path components
      • Accept GET or POST parameters
      • Getting the URL of an action
      • Cached actions
      • Brute force attacks
    • Patterns guide
      • Passing variables to a pattern
      • Nested patterns
      • Cached patterns
    • Cache guide
      • Time To Live
      • Using cache
      • Lists
      • Queues
      • Pools
    • Database guide
      • Basic queries
      • Prepared queries
      • Cached queries
      • Cache key naming
      • Removing queries from cache
    • Items guide
      • Item cache
      • Item lists
      • Items custom filters
      • Items custom ordering
      • Mixing filters and ordering
      • Items with relationships
      • Items cache
    • HtmlDocument guide
    • Css and Javascript guide
      • Modules injecting CSS and JavaScript
    • Session guide
    • Login guide
      • Creating a complete login workflow
    • Locale guide
      • Multilingual texts
      • Domain based site localization
    • Log guide
      • Loading Log events from the database
    • Stats guide
      • Stats events with additional dimensions
      • Loading Stats events from the database
    • Janitor guide
      • Janitor tasks configuration files
    • Command line interface
    • Debugging
  • Reference
    • Core modules
      • Actions
        • Actions methods
      • Browser
      • Cache
        • Cache methods
      • Css
        • Css methods
      • Database
      • Email
      • Errors
      • HtmlDocument
        • HtmlDocument methods
      • ItemAdmin
      • Janitor
        • Janitor methods
      • Javascript
        • Javascript methods
      • Locale
        • Locale methods
      • Log
        • Log methods
      • Login
        • Login methods
      • Output
        • Output methods
      • Patterns
        • Patterns methods
      • Security
        • Security methods
      • Session
        • Session methods
      • Stats
        • Stats methods
      • SystemLog
      • TableAdmin
      • Translation
      • Validate
    • Core classes
      • Action
        • Action methods
        • Action properties
      • AjaxResponseJson
      • BasicObject
        • BasicObject methods
      • CacheProvider
        • CacheProvider methods
      • Color
      • DatabaseProvider
        • DatabaseProvider methods
      • DatabaseResult
        • DatabaseResult methods
        • DatabaseResult properties
      • DatabaseRow
      • Engine
        • Engine methods
        • Engine properties
      • Gradient
      • Item
        • Item methods
        • Item properties
      • Items
        • Items methods
        • Items properties
      • Image
      • JanitorTask
        • JanitorTask methods
        • JanitorTask properties
      • LogEvent
        • LogEvent methods
        • LogEvent Properties
      • LogEvents
        • LogEvents methods
      • Module
        • Module methods
        • Module properties
      • Response
      • Request
        • Request methods
      • RequestParameter
        • RequestParameter methods
      • RequestPathComponent
        • RequestPathComponent methods
      • Result
      • StatsEvent
        • StatsEvent properties
      • StatsEvents
        • StatsEvents methods
      • SystemLogEvent
        • SystemLogEvent methods
        • SystemLogEvent properties
      • SystemLogEvents
        • SystemLogEvents methods
  • Code conventions
  • License
  • Extras
Powered by GitBook
On this page
  • attendCliRequest
  • attendWebRequest
  • callMethodOnAllModules( methodName )
  • end
  • getStatus
  • getStatusHumanReadable
  • getStatusHtml
  • init( appNamespace, setup )
  • loadAppModule( moduleName, requiredByModuleName )
  • loadCoreModule( moduleName, requiredByModuleName )

Was this helpful?

  1. Reference
  2. Core classes
  3. Engine

Engine methods

PreviousEngineNextEngine properties

Last updated 3 years ago

Was this helpful?

attendCliRequest

Attends the request received from the CLI interface.

attendWebRequest

Attends the request received from a web server by calling Actions::run with the requested URI string

callMethodOnAllModules( methodName )

Calls the specified static method on all the available Core and App modules where it's implemented, and then loads those modules.

  • methodName The method name to call

end

Ends the application by calling the end methods of all the loaded modules.

getStatus

Returns information about the engine and its current status, including the loaded modules, the mapped actions and some benchmarks.

Note that some information on the return array will be missing if the isDevel option has not been activated when initializing the engine. This also applies to the and methods.

Returns: A hash array with the information

getStatusHumanReadable

Returns: A hash array with the status information in a human readable format

getStatusHtml

Returns an HTML version of the status in a human readable format.

Returns: The HTML code

init( appNamespace, setup )

Initializes the Cherrycake engine.

  • appNamespace The app namespace

  • setup Optional hash array

    • appName The app name

    • isDevel Set it to true if the app is running in a development environment

    • isUnderMaintenance Whether the App is under maintenance or not

    • isCli Whether the engine is running as a cli or not. When not specified, it will autodetect.

    • configDir The directory where configuration files are stored

    • appModulesDir The directory where app modules are stored

    • appClassesDir The directory where app classes are stored

    • timezoneName The system's timezone. All modules, including Database for date/time retrievals/saves will be made taking this timezone into account. The server is expected to run on this timezone. Default: Etc/UTC

    • timezoneId The system's timezone. The same as timezoneName, but the matching id on the Cherrycake timezones database table. Default: 532 (532 is the id for the Etc/UTC time zone)

    • baseAppModules An ordered array of the base App module names that has to be always loaded on application start.

    • additionalAppConfigFiles An ordered array of any additional App config file names to load from the App config directory.

Returns: Boolean indicating whether all the modules have been loaded ok or not.

loadAppModule( moduleName, requiredByModuleName )

  • moduleName The name of the module.

  • requiredByModuleName Optional name of the module that required to load the module.

loadCoreModule( moduleName, requiredByModuleName )

  • moduleName The name of the module.

  • requiredByModuleName Optional name of the module that required to load the module.

Returns a human-readable version of the status information provided by the method.

baseCoreModules An ordered array of the base Core module names that has to be always loaded on application start. Defaults to ["Actions"]. This list should include the module to provide some kind of functionality to the app, since otherwise it wouldn't be answering any requests and will be completely unusable, except if you're experimenting with different ways of using the Cherrycake engine. See .

Loads an .

Loads a Core .

Actions
Working with Actions
App module
module
getStatusHumanReadable
getStatusHtml
getStatus