Overview

Namespaces

  • Charcoal
    • App
      • Action
      • Config
      • Handler
      • Middleware
      • Module
      • Route
      • Script
      • ServiceProvider
      • Template

Classes

  • App
  • AppConfig
  • AppContainer

Interfaces

  • AppAwareInterface

Traits

  • AppAwareTrait
  • CallableResolverAwareTrait
  • Overview
  • Namespace
  • Class

Class AppConfig

Charcoal App configuration

Charcoal\Config\AbstractConfig
Extended by Charcoal\App\AppConfig
Namespace: Charcoal\App
Located at Charcoal/App/AppConfig.php
Methods summary
public array
# defaults( )

Default app-config values.

Default app-config values.

Returns

array
public Charcoal\App\AppConfig
# setBasePath( string $path )

Set the application's absolute root path.

Set the application's absolute root path.

Resolves symlinks with realpath() and ensure trailing slash.

Parameters

$path
The absolute path to the application's root directory.

Returns

Charcoal\App\AppConfig
Chainable

Throws

InvalidArgumentException
If the argument is not a string.
public string
# basePath( )

Retrieve the application's absolute root path.

Retrieve the application's absolute root path.

Returns

string
The absolute path to the application's root directory.
public Charcoal\App\AppConfig
# setPublicPath( string $path )

Set the application's absolute path to the public web directory.

Set the application's absolute path to the public web directory.

Parameters

$path
The path to the application's public directory.

Returns

Charcoal\App\AppConfig
Chainable

Throws

InvalidArgumentException
If the argument is not a string.
public string
# publicPath( )

Retrieve the application's absolute path to the public web directory.

Retrieve the application's absolute path to the public web directory.

Returns

string
The absolute path to the application's public directory.
public
# setStoragePath( string|null $path )

Set the application's absolute path to the storage directory.

Set the application's absolute path to the storage directory.

Parameters

$path
The path to the application's storage directory.

Returns


$this

Throws

InvalidArgumentException
If the argument is not a string.
public string
# storagePath( )

Get the path to the storage directory.

Get the path to the storage directory.

Note that the storage space is outside of the public access.

Returns

string
public Charcoal\App\AppConfig
# setBaseUrl( Psr\Http\Message\UriInterface|string $uri )

Set the application's fully qualified base URL to the public web directory.

Set the application's fully qualified base URL to the public web directory.

Parameters

$uri
The base URI to the application's web directory.

Returns

Charcoal\App\AppConfig
Chainable
public Psr\Http\Message\UriInterface|null
# baseUrl( )

Retrieve the application's fully qualified base URL to the public web directory.

Retrieve the application's fully qualified base URL to the public web directory.

Returns

Psr\Http\Message\UriInterface|null
The base URI to the application's web directory.
public Charcoal\App\AppConfig
# setTimezone( string $timezone )

Set the application's default timezone.

Set the application's default timezone.

Parameters

$timezone
The timezone string.

Returns

Charcoal\App\AppConfig
Chainable

Throws

InvalidArgumentException
If the argument is not a string.
public string
# timezone( )

Retrieve the application's default timezone.

Retrieve the application's default timezone.

Will be used by the PHP date and date-time functions.

Returns

string
public Charcoal\App\AppConfig
# setProjectName( string|null $projectName )

Sets the project name.

Sets the project name.

Parameters

$projectName
The project name.

Returns

Charcoal\App\AppConfig
Chainable

Throws

InvalidArgumentException
If the project argument is not a string (or null).
public string|null
# projectName( )

Returns

string|null
public Charcoal\App\AppConfig
# setDevMode( boolean $devMode )

Parameters

$devMode
The "dev mode" flag.

Returns

Charcoal\App\AppConfig
Chainable
public boolean
# devMode( )

Returns

boolean
public Charcoal\App\AppConfig
# setView( array $view )

Parameters

$view
The view configuration structure to set.

Returns

Charcoal\App\AppConfig
Chainable
public Charcoal\App\AppConfig
# setRoutes( array $routes )

Parse the application's route configuration.

Parse the application's route configuration.

Parameters

$routes
The route configuration structure to set.

Returns

Charcoal\App\AppConfig
Chainable

See

\Charcoal\Admin\Config::setRoutes() For a similar implementation.
public array
# routes( )

Returns

array
public Charcoal\App\AppConfig
# setRoutables( array $routables )

Parameters

$routables
The routable configuration structure to set.

Returns

Charcoal\App\AppConfig
Chainable
public array
# routables( )

Returns

array
public Charcoal\App\AppConfig
# setHandlers( array $handlers )

Define custom response and error handlers.

Define custom response and error handlers.

Slim provides five standard handlers: - "foundHandler" - "notFoundHandler" - "notAllowedHandler" - "errorHandler" - "phpErrorHandler"

Parameters

$handlers
The handlers configuration structure to set.

Returns

Charcoal\App\AppConfig
Chainable
public array
# handlers( )

Returns

array
public Charcoal\App\AppConfig
# setModules( array $modules )

Set the configuration modules.

Set the configuration modules.

The modules are defined in a key=>\Charcoal\App\Module\ModuleConfig structure.

Parameters

$modules
The module configuration structure to set.

Returns

Charcoal\App\AppConfig
Chainable
public array
# modules( )

Returns

array
public Charcoal\App\AppConfig
# setCache( array|Charcoal\App\Config\CacheConfig $cache )

Parameters

$cache
The application global cache config.

Returns

Charcoal\App\AppConfig
Chainable

Throws

InvalidArgumentException
If the argument is not an array or a config.
public Charcoal\App\Config\CacheConfig
# cache( )

Get the application's global CacheConfig.

Get the application's global CacheConfig.

Returns

Charcoal\App\Config\CacheConfig
public Charcoal\App\AppConfig
# setLogger( array|Charcoal\App\Config\LoggerConfig $logger )

Parameters

$logger
The global logger config.

Returns

Charcoal\App\AppConfig
Chainable

Throws

InvalidArgumentException
If the argument is not an array or a config.
public Charcoal\App\Config\LoggerConfig
# logger( )

Get the application's global LoggerConfig

Get the application's global LoggerConfig

Returns

Charcoal\App\Config\LoggerConfig
public Config
# setDatabases( array $databases )

Parameters

$databases
The avaiable databases config.

Returns

Config
Chainable
public array
# databases( )

Returns

array

Throws

Exception
If trying to access this method and no databases were set.
public array
# databaseConfig( string $ident )

Parameters

$ident
The ident of the database to return the configuration of.

Returns

array

Throws

InvalidArgumentException
If the ident argument is not a string.
Exception
If trying to access an invalid database.
public Charcoal\App\AppConfig
# setDefaultDatabase( string $defaultDatabase )

Parameters

$defaultDatabase
The default database ident.

Returns

Charcoal\App\AppConfig
Chainable

Throws

InvalidArgumentException
If the argument is not a string.
public Charcoal\App\AppConfig
# addDatabase( string $ident, array $config )

Parameters

$ident
The database ident.
$config
The database options.

Returns

Charcoal\App\AppConfig
Chainable

Throws

InvalidArgumentException
If the arguments are invalid.
public mixed
# defaultDatabase( )

Returns

mixed

Throws

Exception
If trying to access this method before a setter.
public Charcoal\App\AppConfig
# setFilesystem( array|Charcoal\App\Config\FilesystemConfig $filesystem )

Parameters

$filesystem
The application global cache config.

Returns

Charcoal\App\AppConfig
Chainable

Throws

InvalidArgumentException
If the argument is not an array or a config.
public Charcoal\App\Config\FilesystemConfig
# filesystem( )

Get the application's global FilesystemConfig

Get the application's global FilesystemConfig

Returns

Charcoal\App\Config\FilesystemConfig
Properties summary
protected Charcoal\View\ViewConfig $view

The application's view/rendering configset.

The application's view/rendering configset.

#
API documentation generated by ApiGen