Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charcoalphp/core
[READ-ONLY] The Charcoal PHP framework
https://github.com/charcoalphp/core
charcoal framework php read-only-repository
Last synced: about 1 month ago
JSON representation
[READ-ONLY] The Charcoal PHP framework
- Host: GitHub
- URL: https://github.com/charcoalphp/core
- Owner: charcoalphp
- License: mit
- Created: 2022-06-21T15:43:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-13T15:05:16.000Z (9 months ago)
- Last Synced: 2024-09-14T13:36:23.594Z (3 months ago)
- Topics: charcoal, framework, php, read-only-repository
- Language: PHP
- Homepage: https://github.com/charcoalphp/charcoal
- Size: 5.09 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Charcoal Core
=============The Core package provides abstract objects and tools for defining object data models and managing datasource connections.
## Installation
```shell
composer require charcoal/core
```For Charcoal projects, the service provider can be registered from your configuration file:
```json
{
"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:
```php
$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.
```php
// 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 `CollectionLoader` to here, somehow.### Validator
The validator namespace is obsolete and should not be used.
Its usage is currently being removed from everywhere in charcoal.## Resources
* [Contributing](https://github.com/charcoalphp/.github/blob/main/CONTRIBUTING.md)
* [Report issues](https://github.com/charcoalphp/charcoal/issues) and
[send pull requests](https://github.com/charcoalphp/charcoal/pulls)
in the [main Charcoal repository](https://github.com/charcoalphp/charcoal)