charcoal / core
Charcoal Web Framework
v5.0.0
2024-03-13 15:05 UTC
Requires
- php: ^7.4 || ^8.0
- ext-mbstring: *
- ext-pdo: *
- charcoal/cache: ^5.0
- charcoal/config: ^5.0
- charcoal/factory: ^5.0
- charcoal/property: ^5.0
- charcoal/view: ^5.0
- pimple/pimple: ^3.0
- psr/cache: ^1.0
- psr/log: ^1.0
Requires (Dev)
- cache/void-adapter: ^1.0
- charcoal/app: ^5.0
- mockery/mockery: ^1.0
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
- tedivm/stash: ~0.16
Replaces
This package is auto-updated.
Last update: 2026-06-13 19:51:16 UTC
README
The Core package provides abstract objects and tools for defining object data models and managing datasource connections.
Installation
composer require charcoal/core
For Charcoal projects, the service provider can be registered from your configuration file:
{
"service_providers": {
"charcoal/model/service-provider/model": {}
}
}
Overview
Loader
TODO
Model
TODO
Source
Source provides storage support to Charcoal models.
Using a Source object directly:
$model = ModelFactory::instance()->create('namespace/model'); $source = SourceFactory::instance()->create('database'); $source->load_item(1, $model);
Using a Storable object, which abstract away the Source completely.
// Model implements StorableInterface with StorableTrait $model = ModelFactory::instance()->create('namespace/model'); // This will load the Model's source from it's metadata $model->load(1);
Available Source
Currently, only the database source is supported.
Database Source
The DatabaseSource source type is currently the only supported storage source.
TODOs
- Implements a
FileSource, at least a basic CSV support. - Move
CollectionLoaderto here, somehow.
Validator
The validator namespace is obsolete and should not be used. Its usage is currently being removed from everywhere in charcoal.