Configuration

ICanBoogie and its components are usually very configurable and come with sensible defaults and a few conventions. Configurations are usually located in config folders, while locale messages are usually located in locale folders. Components configure themselves thanks to ICanBoogie's Autoconfig feature, and won't require much of you other than a line in the composer.json file of your application.

Configuring the application

The Application instance is configured with app configuration fragments. The fragment used by your application is usually located in the /app/all/config/app.php file.

The following example demonstrates how to enable configs caching and how to specify the name of the session and its scope.

<?php

namespace ICanBoogie;

// app/all/config/app.php

return [

    AppConfig::CACHE_CONFIGS => true,
    AppConfig::SESSION => [

        SessionOptions::OPTION_NAME => "ICanBoogie",
        SessionOptions::OPTION_COOKIE_PARAMS => [

            Session\CookieParams::OPTION_DOMAIN => ".example.org"

        ]

    ]

];

Note: Check ICanBoogie's config/app.php for a list of available options and their default values.

Specify a storage engine for synthesized configurations

A storage engine for synthesized configurations may be specified with the AppConfig::STORAGE_FOR_CONFIGS option. You may specify a class name or a callable that would return a Storage instance.

The default implementation returns a FileStorage instance, or if APC is available a StorageCollection made of an APCStorage instance and a FileStorage instance.

Specify a storage engine for variables

A storage engine for variables may be specified with the AppConfig::STORAGE_FOR_VARIABLES option. You may specify a class name or a callable that would return a Storage instance.

The default implementation returns a FileStorage instance, or if APC is available a StorageCollection made of an APCStorage instance and a FileStorage instance.