pclib  3.2.0
Lightweight PHP framework
Configuration parameters

Configuration parameters are stored in php arrays, where array $config is used always.
Optionally you can use array $develop, which is used for development (localhost default) and $production, which is used for any non-development ip-address.
Keys from $production and $develop will rewrite $config keys.

  • pclib.errors - How errors will be displayed.

    • display - Display error messages (true / false or 'php' for php default error handling)
    • develop - Display develop informations in errors (stack-trace)
    • log - Log errors into database
    • template - Template used for displaying error on production. Uses 'pclib/tpl/error.tpl' by default.

    Example configuration:

    $develop['pclib.errors'] = ['display' => true, 'develop' => true];
    $production['pclib.errors'] = ['display' => true, 'log' => true, 'develop' => false];
  • pclib.locale - Locale settings. You can set date and datetime format in strftime syntax.
    • date
    • datetime
  • pclib.paths' - Various paths used by framework
    • assets - Path to pclib assets such as css, js or image files (pclib/www/)
    • localization - Path to localization files (pclib/localization/)
    • templates - Default system templates (pclib/tpl/)
  • pclib.security - Security settings. All parameters are boolean true/false.
    • tpl-escape - Always escape template values. XSS attack protection.
    • csrf - Add csrf hidden field into form. CSRF attack protection.
    • form-prevent-mass - Do not allow submit fields which does not exists in form elements. Mass-assignment attack protection.
  • pclib.auth - Authentication settings.
    • algo - Password hash algorithm. Can be 'md5', 'bcrypt', 'bcrypt-md5'. Default is 'md5'.
    • secret - Random secret string used for increasing safety of md5 hash
    • realm - (optional) User has access only to realm where he is logged in. By default it is application name, so different apps on the same server has separated access.
  • pclib.app - Configure application object
    • language - Set application language ('cs', 'en' ...)
    • debugmode - enables debug mode (true/false)
    • friendly-url - enables friendly url (true/false)
    • layout - path to layout template
    • default-route - default application route (example: 'home/welcome')
    • autostart - list of services, which will be started automatically (example: ['db', 'auth'])
    • plugins - list of used plugins (example: ['someplugin'])