K
K
Karl Meinhoff2016-06-27 12:04:11
PHP
Karl Meinhoff, 2016-06-27 12:04:11

Modular system in PHP, how to protect?

There was a need to write a project in PHP5, the so-called core for subsequent writing and connecting modules to it. The project is designed to ensure that modules for it are written not only by my hands, but also by other users. More specifically, a module will most likely be represented as a file containing the module's class. Right now I'm interested in the following:

  • How to restrict module access to database within one table?
  • How to disable include module of kernel files?
  • How to prevent a module from performing certain functions in any manifestation?

Can you tell me where to smoke, what libraries or methods will be used?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MetaDone, 2016-06-27
@KarleKremen

the module will most likely be represented as a file containing the module class

Apparently there will be a hellish mixture of requests to the database and logic. In general, one class-file is indispensable here.
Read about inversion of control and dependency injection, questions will disappear.
It will turn out that the user module will use only what your "kernel" passes to it and nothing more.

N
novrm, 2016-06-27
@novrm

Maybe I didn’t quite understand - but you write your own bicycle framework ...
What did you not like, for example, Zend or Symfony?
Yes - still - use the principle: - one class - one file - single responsibility.
And then, as I understand it, your module class will connect other modules and work with the database and perform some other functions ... This is the road to hell ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question