开发者

php plugin question

开发者 https://www.devze.com 2023-04-03 13:50 出处:网络
I have a PHP-mysql application which is running by portable server (i.e.XAMPP). The client buy additional functions (like Chart, report) after using the gerneral app.

I have a PHP-mysql application which is running by portable server (i.e.XAMPP). The client buy additional functions (like Chart, report) after using the gerneral app.

However, for example, there are some links need to be linked from general app to additional function after installing. Those links will be disabled w开发者_运维问答hen the addtional function hasn't been installed.

My question is how to solve the above scenario? Really appreciate for any help and Thanks in advance.


A simple solution would be to define a constant, for example PLUGIN_CHART, in the plugin and in the main app just check if the constant exists and is true.

If the plugins are actual functions, another way is to use function_exists() to check if it's available.


There are several ways of going about it, here is a simple way:

Have a directory called plugins. Within that directory create a folder for each plugin you have. For each of your client, put only the plugins they will be using.

Now, instead of linking each possible plugin, check to see if the plugin is loaded (or at least if the directory exists), if it does, create a link!

0

精彩评论

暂无评论...
验证码 换一张
取 消