fruit / core
Core components of Fruit framework
Requires
- symfony/yaml: ~3
Requires (Dev)
This package is auto-updated.
Last update: 2024-12-13 00:05:43 UTC
README
This package is the core of Fruit Framework.
Fruit is still under development, not usable now.
What is Fruit
A fruit is the seed-bearing structure in angiosperms formed from the ovary after flowering. (Wikipedia)
Fruit framework tries to restructure the configuration and helper modules into raw executable PHP code.
Explain it
Basically, Fruit converts dynamic call into static call.
The work flow when a request comes in in most web frameworks is something like
- Execute a special PHP script (entry point), prepare basic data like auto-loading information.
- Load configuration. Mostly by passing config file to a helper class.
- Parse the configuration, load needed modules (like router) and pass related config items to it.
- Find correct controller using router, and execute it.
For knowing which module is "needed", frameworks must prepare a set of data, then parse it to dynamically load the modules.
Fruit works differently.
It provides a command line tool to "compile" your configuration file into an "entry file", and provides a helper object for you to load (and initialize) needed modules on demand. Since the helper object is "generated", it needs not "prepare some data and parse it" to find out correct module you want: such logics are hard-coded in the helper object.
License
Any version of MIT, GPL or LGPL.