I need to develop an application that fits with several projects with common features, however each one has several specific rules.
What I need is a structure that allows me to easily change these rules, in case I chose to save the rules in the database and use the eval()
function to execute the code in the application, however, I do not think this would be the best option to get the result I need (nor the safest, even if the rules are encrypted).
Structure I'm using now is:
app
controller [controllers]
model [models] [aqui são aplicados as regras do banco de dados]
entity [entidades do banco de dados]
repository [model <=> entity]
helper [helpers]
view [views]
theme [themes]
config
[configurações da aplicação]
data
logs [app logs]
cache [view cache]
public
[módulos angular, assets, index.php e .htaccess]
vendor
[libraries, app-core]
The rules would apply more or less like this:
// Random key (config)
define('PRIVATE_KEY', 'SECURE_RANDOM_KEY');
// antes
foreach ( regras as regra )
parse(decode(regra, PRIVATE_KEY));
// continua execução
Any idea how I could improve this?