ICanBoogie/ICanBoogie 3.0.x
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • Autoconfig
    • Binding
    • Core
    • Routing
    • Session

Classes

  • AlreadyAuthenticated
  • Core
  • Debug
  • Helpers
  • Hooks
  • Logger
  • LogLevel
  • SessionWithEvent

Interfaces

  • LoggerInterface

Traits

  • AppAccessor
  • LoggerTrait

Exceptions

  • CoreAlreadyBooted
  • CoreAlreadyInstantiated
  • CoreAlreadyRunning
  • CoreNotInstantiated

Constants

  • TOKEN_ALPHA
  • TOKEN_ALPHA_UPCASE
  • TOKEN_NUMERIC
  • TOKEN_SYMBOL
  • TOKEN_SYMBOL_WIDE

Functions

  • app
  • boot
  • excerpt
  • generate_token
  • generate_token_wide
  • get_autoconfig
  • log
  • log_error
  • log_info
  • log_success
  • log_time
  • resolve_app_paths
  • resolve_instance_name
  • strip_root

Class Core

Core of the ICanBoogie framework.

ICanBoogie\Core uses ICanBoogie\PrototypeTrait (not available) ICanBoogie\Binding\Event\CoreBindings (not available) ICanBoogie\Binding\HTTP\CoreBindings (not available)
Namespace: ICanBoogie
Located at Core.php

Methods summary

protected boolean
# get_is_configured( )

Whether the core is configured.

Whether the core is configured.

Returns

boolean
true if the core is configured, false otherwise.
protected boolean
# get_is_booting( )

Whether the core is booting.

Whether the core is booting.

Returns

boolean
true if the core is booting, false otherwise.
protected boolean
# get_is_booted( )

Whether the core is booted.

Whether the core is booted.

Returns

boolean
true if the core is booted, false otherwise.
protected boolean
# get_is_running( )

Whether the core is running.

Whether the core is running.

Returns

boolean
true if the core is running, false otherwise.
public static ICanBoogie\Core
# get( )

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.
public
# assert_not_booted( )

Asserts that the application is not booted yet.

Asserts that the application is not booted yet.

Throws

ICanBoogie\CoreAlreadyBooted
if the application is already booted.
public
# assert_not_running( )

Asserts that the application is not running yet.

Asserts that the application is not running yet.

Throws

ICanBoogie\CoreAlreadyRunning
if the application is already running.
protected Config
# create_config_manager( array $paths, array $synthesizers )

Returns configuration manager.

Returns configuration manager.

Parameters

$paths
Path list.
$synthesizers
Configuration synthesizers.

Returns

Config
protected
# apply_config( array $config )

Applies low-level configuration.

Applies low-level configuration.

Parameters

$config
protected ICanBoogie\Storage\Storage
# create_storage( string|callable $engine )

Creates a storage engine.

Creates a storage engine.

Parameters

$engine
A class name or a callable.

Returns

ICanBoogie\Storage\Storage
protected ICanBoogie\Storage\Storage
# create_storage_for_configs( string|callable $engine )

Creates storage engine for synthesized configs.

Creates storage engine for synthesized configs.

Parameters

$engine
A class name or a callable.

Returns

ICanBoogie\Storage\Storage
protected ICanBoogie\Storage\Storage
# get_storage_for_configs( )

Returns

ICanBoogie\Storage\Storage
protected ICanBoogie\Storage\Storage
# create_storage_for_vars( string|callable $engine )

Creates storage engine for variables.

Creates storage engine for variables.

Parameters

$engine
A class name or a callable.

Returns

ICanBoogie\Storage\Storage
protected ICanBoogie\Storage\Storage
# lazy_get_vars( )

Returns the non-volatile variables registry.

Returns the non-volatile variables registry.

Returns

ICanBoogie\Storage\Storage
protected array
# lazy_get_config( )

Returns the core configuration.

Returns the core configuration.

Returns

array
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 TimeZone
# get_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 mixed
# change_status( integer $status, callable $callable )

Changes the status of the application.

Changes the status of the application.

Parameters

$status
$callable

Returns

mixed
protected
# configure( )

Configures the application.

Configures the application.

The configure event of class ICanBoogie\Core\ConfigureEvent is fired after the application is configured. Event hooks may use this event to further configure the application.

public
# boot( )

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( ICanBoogie\HTTP\Request $request = null )

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 boot() method is invoked if the core has not booted yet.

Parameters

$request
The request to handle. If null, the initial request is used.
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
protected
# initialize_response_header( )

Initializes default response header.

Initializes default response header.

The default response has the ICanBoogie\Status::INTERNAL_SERVER_ERROR status code and the appropriate header fields so it is not cached. That way, if something goes wrong and an error message is displayed it won't be cached by a proxi.

Constants summary

integer STATUS_VOID

Status of the application.

Status of the application.

# 0
integer STATUS_INSTANTIATING
# 1
integer STATUS_INSTANTIATED
# 2
integer STATUS_CONFIGURING
# 3
integer STATUS_CONFIGURED
# 4
integer STATUS_BOOTING
# 5
integer STATUS_BOOTED
# 6
integer STATUS_RUNNING
# 7
integer STATUS_TERMINATED
# 8

Properties summary

Magic properties

public Config $configs

Configurations manager.

public ICanBoogie\Storage\Storage $vars

Persistent variables registry.

public Session $session

User's session.

public string $language

Locale language.

public string|integer $timezone

Time zone.

public array $config

The "core" configuration.

public read-only boolean $is_configured

true if the core is configured, false otherwise.

public read-only boolean $is_booting

true if the core is booting, false otherwise.

public read-only boolean $is_booted

true if the core is booted, false otherwise.

public read-only boolean $is_running

true if the core is running, false otherwise.

public read-only ICanBoogie\LoggerInterface $logger

The message logger.

public read-only ICanBoogie\Storage\Storage $storage_for_configs
ICanBoogie/ICanBoogie 3.0.x API documentation generated by ApiGen