charcoal / app
Charcoal application, based on Slim 3
Requires
- php: ^7.4 || ^8.0
- ext-pdo: *
- charcoal/cache: ^5.0
- charcoal/config: ^5.0
- charcoal/factory: ^5.0
- charcoal/translator: ^5.0
- charcoal/view: ^5.0
- league/climate: ^3.2
- league/flysystem: ^1.0
- monolog/monolog: ^1.17
- psr/http-message: ^1.0
- psr/log: ^1.0
- slim/slim: ^3.7
- vlucas/phpdotenv: ^5.4
Requires (Dev)
- league/flysystem-aws-s3-v3: ^1.0
- league/flysystem-memory: ^1.0
- league/flysystem-sftp: ^1.0
- mockery/mockery: ^1.0
- mustache/mustache: ^2.11
- php-coveralls/php-coveralls: ^2.2
- phpstan/phpstan: ^1.6
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
- tedivm/stash: ~0.16
Replaces
- dev-main / 5.x-dev
- v5.0.0
- v4.0.2
- v4.0.1
- v4.0.0
- v3.1.8
- v3.1.7
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.2
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.5
- 0.8.4.1
- 0.8.4
- 0.8.3.3
- 0.8.3.2
- 0.8.3.1
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.1
- 0.7
- 0.6.1
- 0.6
- 0.5.3
- 0.5.2
- 0.5.1.3
- 0.5.1.2
- 0.5.1.1
- 0.5.1
- 0.5.0.1
- 0.5
- 0.4.8
- 0.4.7
- 0.4.6
- 0.4.5.3
- 0.4.5.2
- 0.4.5.1
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4
- 0.3.1
- 0.3
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2
- 0.1.1
- 0.1
- dev-mcaskill-patch-improve-script-args
- dev-mcaskill-patch-from-base-path
- dev-slim4
- dev-fix/template-init
- dev-joel-start-fixing-config-merge
- dev-mducharme-scripts
- dev-mcaskill-develop
- dev-mcaskill-psr11
This package is auto-updated.
Last update: 2024-12-13 19:22:50 UTC
README
The App package provides integration with Slim and Pimple for building user-facing Web applications and APIs.
Installation
composer require charcoal/app
Overview
The App package is a collection of modules, routes (templates
, actions
and scripts
), handlers, and services tied together with a config, a service container, and service providers.
The framework features (internally and externally) the following:
- PSR-3 logger
- PSR-6 cache system[†]
- PSR-7 kernel (web, API, CLI)
- PSR-11 container
- Translation layer[†]
- File system layer
- Database layer
- View layer[†]
Notes:
- [†] Provided by external Charcoal components.
Components
The main components of the Charcoal App are:
Learn more about components.
Service Providers
Dependencies and extensions are handled by a dependency container, using Pimple, which can be defined via service providers (Pimple\ServiceProviderInterface
).
Included Providers
The Charcoal App comes with several providers out of the box. All of these are within the Charcoal\App\ServiceProvider
namespace:
External Providers
The Charcoal App requires a few providers from independent components. The following use their own namespace and are automatically injected via the AppServiceProvider
:
Learn more about service providers.
Usage
Typical front-controller (www/index.php
):
use Charcoal\App\App; use Charcoal\App\AppConfig; use Charcoal\App\AppContainer; include '../vendor/autoload.php'; $config = new AppConfig(); $config->addFile(__DIR__.'/../config/config.php'); $config->set('ROOT', dirname(__DIR__) . '/'); // Create container and configure it (with charcoal/config) $container = new AppContainer([ 'settings' => [ 'displayErrorDetails' => true, ], 'config' => $config, ]); // Charcoal / Slim is the main app $app = App::instance($container); $app->run();
For a complete project example using charcoal/app
, see the charcoal/boilerplate.