ICanBoogie/ICanBoogie 4.0.x
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • Application
    • Autoconfig
    • Binding
    • Routing
    • Session

Classes

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

Interfaces

  • LoggerInterface

Traits

  • AppAccessor
  • LoggerTrait

Exceptions

  • ApplicationAlreadyBooted
  • ApplicationAlreadyInstantiated
  • ApplicationAlreadyRunning
  • ApplicationNotInstantiated

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\ApplicationBindings (not available) ICanBoogie\Binding\HTTP\ApplicationBindings (not available) ICanBoogie\Binding\Routing\ApplicationBindings (not available)
Abstract
Namespace: ICanBoogie
Located at Core.php

Methods summary

protected boolean
# get_is_configured( )

Whether the application is configured.

Whether the application is configured.

Returns

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

Whether the application is booting.

Whether the application is booting.

Returns

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

Whether the application is booted.

Whether the application is booted.

Returns

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

Whether the application is running.

Whether the application is running.

Returns

boolean
true if the application is running, false otherwise.
public static Application
# get( )

Returns the unique instance of the application.

Returns the unique instance of the application.

Returns

Application
public
# __construct( array $options = [] )

Constructor.

Constructor.

Parameters

$options
Initial options to create the application.

Throws

ICanBoogie\ApplicationAlreadyInstantiated
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\ApplicationAlreadyBooted
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\ApplicationAlreadyRunning
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 app configuration.

Returns the app 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 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 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\ApplicationAlreadyBooted
in attempt to boot the application 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 application 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 application has not booted yet.

Parameters

$request
The request to handle. If null, the initial request is used.
public
# clear_cache( )

Fires the ICanBoogie\Application::clear_cache event.

Fires the ICanBoogie\Application::clear_cache event.

protected
# run( ICanBoogie\HTTP\Request $request )

Fires the ICanBoogie\Application::run event.

Fires the ICanBoogie\Application::run event.

Parameters

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

Terminate the application.

Terminate the application.

Fires the ICanBoogie\Application::terminate event of class ICanBoogie\Application\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 "app" configuration.

public read-only boolean $is_configured

true if the application is configured, false otherwise.

public read-only boolean $is_booting

true if the application is booting, false otherwise.

public read-only boolean $is_booted

true if the application is booted, false otherwise.

public read-only boolean $is_running

true if the application is running, false otherwise.

public read-only ICanBoogie\LoggerInterface $logger

The message logger.

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