pclib  3.0.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 'assets/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.directories' - Various paths used by framework
    • logs - Path for text log files /generated by logdump() for example/
    • assets - Path to pclib assets (css,js,image files)
    • localization - Path to localization files
  • 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' or 'bcrypt' /will use php password_hash() function/
    • 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 - Enable and configure application services
    • db, logger, file-storage - Initialize app services
    • debugbar = true - enables debug mode
    • friendly-url = true - enables friendly url
    • layout - path to layout template