There was a need to write a project in PHP5, so-called core for later writing and connecting modules. The project is calculated to modules has been written to it, not only my hands but also other users. More specifically, the module is likely to be presented in the form of a file containing the module class. Now I'm interested in the following items:
- How do I restrict module access to the database within one table?
- How to disable the module include files of the kernel?
- How to disable the module some functions in any manifestation?
You will not prompt, where to smoke, what libraries or methods to apply?
Next - your repository/model for module/entity active record/something that communicates with the data warehouse has somewhere to get to know nothing more.
It turns out that the kernel creates a specimen of your essence to work with the data, gives her what table it works, gives her something that can get data from the repository. After all the essence of the transfer controller module that will pull methods of this entity.
If you want as much as possible to limit the module, we can write interfaces for your entities based on them to implement such basic entities for tables that will run the modules, and then using the container for dependencies to declare relations of entities with interfaces and have them transfer in-type controller module. then you can do one file
for example will be
https://gist.github.com/MetaDone/4ad23763b3027e116... - Chyna.Jerde commented on July 8th 19 at 11:53
or look in the direction of https://zephir-lang.com/ and submit your code as an extension, just hide implementation details, and interfaces will prompt end users that need to be implemented in the framework of the module and that they can use - Chyna.Jerde commented on July 8th 19 at 11:59