ICanBoogie
  • Documentation
  • API Reference
  • ICanBoogie v2.3.0
Namespaces
  • ICanBoogie
    • Autoconfig
    • Core
    • HTTP
      • Dispatcher
    • Session
Classes
  • Core
  • Debug
  • Helpers
  • Logger
  • LogLevel
  • Session
Interfaces
  • LoggerInterface
Traits
  • LoggerTrait
Exceptions
  • AlreadyAuthenticated
  • AuthenticationRequired
  • CoreAlreadyBooted
  • CoreAlreadyInstantiated
  • CoreNotInstantiated
  • PermissionRequired
  • SecurityException

Class Core

Core of the framework.

ICanBoogie\Object
┗ ICanBoogie\Core
Namespace: ICanBoogie
Located at Core.php

Methods summary

public static get( void ) : ICanBoogie\Core

Returns the unique instance of the core object.

Returns the unique instance of the core object.

Returns

ICanBoogie\Core
The core object.
public __construct( array $options = [] )

Constructor.

Constructor.

Parameters

$options
Initial options to create the core object.

Throws

ICanBoogie\CoreAlreadyInstantiated
in attempt to create a second instance.
protected create_config_manager( $path_list, $constructors )
protected lazy_get_vars( void ) : ICanBoogie\Storage\FileStorage

Returns the non-volatile variables registry.

Returns the non-volatile variables registry.

Returns

ICanBoogie\Storage\FileStorage
protected lazy_get_config( void ) : array

Returns the core configuration.

Returns the core configuration.

Returns

array
protected get_dispatcher( void ) : HTTP\Dispatcher

Returns the dispatcher used to dispatch HTTP requests.

Returns the dispatcher used to dispatch HTTP requests.

Returns

HTTP\Dispatcher
protected lazy_get_initial_request( void ) : ICanBoogie\HTTP\Request

Returns the initial request object.

Returns the initial request object.

Returns

ICanBoogie\HTTP\Request
protected get_request( void ) : ICanBoogie\HTTP\Request

Returns the current request.

Returns the current request.

Returns

ICanBoogie\HTTP\Request
protected get_language( void ) : string

Returns the locale language.

Returns the locale language.

Returns

string
protected set_timezone( TimeZone|string|integer $timezone )

Sets the working time zone.

Sets the working time zone.

When the time zone is set the default time zone is also set with date_default_timezone_set().

Parameters

$timezone

An instance of TimeZone, the name of a time zone, or numeric equivalent e.g. 3600.

protected get_timezone( void ) : TimeZone

Returns the working time zone.

Returns the working time zone.

If the time zone is not defined yet it defaults to the value of date_default_timezone_get() or "UTC".

Returns

TimeZone
protected get_is_booted( void )
protected get_is_booting( void )
public boot( void )

Boot the modules and configure Debug, Prototype and Events.

Boot the modules and configure Debug, Prototype and Events.

The boot event of class ICanBoogie\Core\BootEvent is fired after the boot is finished.

The ICANBOOGIE_READY_TIME_FLOAT key is added to the $_SERVER super global with the micro-time at which the boot finished.

Throws

ICanBoogie\CoreAlreadyBooted
in attempt to boot the core twice.
public __invoke( void )

Run the application.

Run the application.

In order to avoid error messages triggered by PHP fatal errors to be send with a 200 (Ok) HTTP code, the HTTP code is changed to 500 before the core is run (and booted). When the process runs properly the HTTP code is changed to the appropriate value by the response.

The ICanBoogie\Core::boot() method is invoked if the core has not booted yet.

protected run( ICanBoogie\HTTP\Request $request )

Fires the ICanBoogie\Core::run event.

Fires the ICanBoogie\Core::run event.

Parameters

$request
protected terminate( ICanBoogie\HTTP\Request $request, ICanBoogie\HTTP\Response $response )

Terminate the application.

Terminate the application.

The method throws the ICanBoogie\Core::terminate event of class ICanBoogie\Core\TerminateEvent.

Parameters

$request
$response
public generate_path( string|ICanBoogie\Routing\Route $pattern_or_route_id_or_route, array $params = null ) : string

Generates a path with the specified parameters.

Generates a path with the specified parameters.

Parameters

$pattern_or_route_id_or_route

A pattern, a route identifier or a ICanBoogie\Routing\Route instance.

$params

Returns

string
public generate_url( $pattern_or_route_id_or_route, $params = null )

Properties summary

public static $is_running : boolean

Whether the core is running or not.

Whether the core is running or not.

false

Magic properties

public $configs : Config

Configurations manager.

public $vars : ICanBoogie\Storage\FileStorage

Persistent variables registry.

public $session : ICanBoogie\Session

User's session.

public $language : string

Locale language.

public $timezone : string|integer

Time zone.

public $config : array

The "core" configuration.

public $initial_request : ICanBoogie\HTTP\Request

The initial request.

public $routes : Routing\Routes

The following properties are provider by icanboogie/module:

public $models : Module\ModelCollection
public $modules : Module\ModuleCollection

The following properties are provider by icanboogie/bind-activerecord:

public $connections : ActiveRecord\ConnectionCollection
public $db : ActiveRecord\Connection

The following properties are provider by icanboogie/bind-render:

public $template_resolver : Render\TemplateResolverInterface
public $template_engines : Render\EngineCollection
public $renderer : Render\Renderer

The following properties are provider by icanboogie/bind-cldr:

public read-only $is_booting : boolean

true if the core is booting, false otherwise.

public read-only $is_booted : boolean

true if the core is booted, false otherwise.

public read-only $request : ICanBoogie\HTTP\Request

The request being processed.

public read-only $events : Events

Event collection.

public read-only $logger : ICanBoogie\LoggerInterface

The message logger. The following properties are provider by icanboogie/routing:

public read-only $locale : CLDR\Locale
public read-only $cldr : CLDR\Repository
ICanBoogie v2.3.0 – Check on GitHub – API documentation generated by ApiGen