meysampg / espricho
A ready to use modular framework (like Yii2) with a powerful container (like Laravel) for php
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 1
Forks: 1
Open Issues: 0
Type:project
Requires
- ext-json: ^1.7
- doctrine/annotations: ^1.6
- doctrine/cache: ^1.8
- doctrine/collections: ^1.6
- elasticsearch/elasticsearch: ^6.7
- guzzlehttp/guzzle: ~6.0
- lcobucci/jwt: ^3.3
- monolog/monolog: ^1.24
- nesbot/carbon: ^2.18
- predis/predis: ^1.1
- symfony/cache: ^4.2
- symfony/console: ^4.2
- symfony/debug: ^4.2
- symfony/dependency-injection: ^4.2
- symfony/event-dispatcher: ^4.2
- symfony/http-foundation: ^4.2
- symfony/http-kernel: ^4.2
- symfony/options-resolver: ^4.2
- symfony/orm-pack: ^1.0
- symfony/property-info: ^4.3
- symfony/routing: ^4.2
- symfony/security: ^4.2
- symfony/serializer: ^4.2
- symfony/validator: ^4.3
- symfony/yaml: ^4.2
Requires (Dev)
- symfony/dotenv: ^4.3
- symfony/var-dumper: ^4.2
This package is auto-updated.
Last update: 2021-07-15 14:23:25 UTC
README
🟥⚠️ THIS PACKAGE IS ABANDONED. PLEASE SELECT ANOTHER PACKAGE OR FORK THIS REPOSITORY AND INFORM ME ON p.g.meysam [at] Gmail [dot] com TO REFER TO YOUR PACKAGE IN PACKAGIST ⚠️🟥
Espricho is a lightwieght framework for php7, based on Symfony components with a built-in modular system support.
Prevision!
Espricho is heavily inspired from Laravel and Yii2. Its modularity is similar to Yii2 but thanks to the Symfony DI container, it has a powerful container like Laravel! Espricho is the Persian name of swallow bird (in Kermani dialect).
Mafsho
mafsho
is a command line tool which provide a lot of functionality
like generators to work more easier with Espricho. It's a Farsi word
means bag (in Kermani dialect). You can run it with php mafsho
command.
Structure
Espricho has a structure like this:
├── Bootstrap
├── Components
├── Configs
├── Console
├── Controllers
├── Databases
├── mafsho
├── Models
├── Modules
├── Public
└── Runtime
We talk about each one in continue.
Configurations VS Environmental Variables
Espricho supports definition of environmental variables (variables which are
depended on the running environment). You should put them on .env
(or .env.dist
which dist
is an application stage) file. It's a good idea if all keys on the .env
file be upper case and start with the section name. For example, all ElasticSearch keys
starts with ELASTICSEARCH_
prefix.
On other side, you can define application
level configurations in the Config/*.yaml
files. Finally both of this
configurations are accessible from sys()->getConfig('dot.notationed.key', 'default')
.
sys.yaml
On sys.yaml
file, you could set the boot parameters of the system. As the
main result, you could define system module loaders under the loader
key.
sys: name: Espricho version: 1.0 max_log_files: 10 loader: - auth - db - modules - redis - elasticsearch
Database Configurations
The database configuration should be set on .env
the root of the project.
A sample for its content is similar
to this:
# Database Configurations
DB_DRIVER=mysql
DB_HOST=localhost
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=root
DB_DATABASE=db_name
Modules
For defining module, you must put your module under the
Modules
folder and define your structure on it. A sample
structure can be something like this:
Modules
└── Shop
├── Configs
│ └── routes.yaml
└── Controllers
└── ProductController.php
Each module has its own route definition rules and they must
be defined on routes.yaml
file under Configs
category.
After definition of module, you can register it on modules.yaml
in Configs
folder of the project's root. A sample
content for this configuration file is:
modules: shop: folder: Shop route_prefix: sh
Each module can have its submodules and they must be defined on
modules.yaml
file in Configs
folder of the module directory.
Definition of routes is similar.