How to make plugin auto installed?

Asked by Hiteshbhai

   As part of our production release, we will be installing our developed plugin as RPM and basically it will create directory within
.../phpdevshell/plugin/.. folder.

    All our configuration will be within the /config/plugin.config.xml file, we want this plugin to be auto installed when user login to the phpdevshell. We don't want someone to go through the Plugin Admin to click on Install..

  We want just the way some ready to use plugin comes auto installed.

   Please help how we can auto configure it?


Question information

English Edit question
PHPDevShell Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Greg (gregfr) said :

Wow this is a cool idea!
We didn't implement this explicitly (mainly for security reasons), but it should be doable. To add this behavior, consider the following points:
- the config file of all plugins are executed at each request, whether the plugin is "installed" or not
- "installing" a plugin is basically only filling some tables in the database, such as menus linked to controllers
- detecting a user login is probably more tricky

What kind of features does your plugin provide?


Revision history for this message
TitanKing (titan-phpdevshell) said :

Another way you could do this is to have a custom database with the plugin already installed. But note that the next version of PHPDevShell plugin manager is much more flexible. You may want to wait for it.

Revision history for this message
Hiteshbhai (hiteshbhai-patel) said :

The project we are doing is internal to our company and it is being develop as plugin within phpdevshell.

We install everything on our system as rpm as i said earlier, so as phpdevshell.
Currently, we have exported the phpdevshell database as sql dump and we create and insert the configuration as part of rpm install.

However, our project is plugin within phpdevshell and it will be separate rpm. Also, our project has his own database which we can create as db dump just like we do for phpdevshell or we can put all our initial queries in ../config/plugin.config.xml file.

The option of creating database dump will not work because we have to create menu with in phpdevshell db and with other option ./config/plugin.config.xml it will create menu and database but then we need to manually install the plugin going through the phpdevshell UI.

We also had an issue applying theme to an individual menu item when we configure it in plugin.config.xml file.

For example, we we create menu from the phpdevshell UI, Manage Menu screen there is a drop down to select the theme (one can select "empty"), we didn't find any option to do that when you define your menu in plugin.config.xml file.

I understand it's bit tricky and odd but that's what our requirement is.

Revision history for this message
TitanKing (titan-phpdevshell) said :

I think I understand what you are saying but remember when installing a new menu or new plugin, all it does is it ads a few entries in the mysql database. Why dont you just add this with your plugin installer. To give you an idea, just by adding database entries in a few tables I can install a plugin without touching PHPDevShell Plugin UI.

Am I missing something?

Revision history for this message
Sherly K. Malone (logodesignbizz05) said :

Install plugin without devshell .

Revision history for this message
Greg (gregfr) said :

I'm sorry is that a question?

Revision history for this message
Hiteshbhai (hiteshbhai-patel) said :

I think that's not the answer, we were looking for.

However, we added new controller and a helper class similar to controllers/plugin-admin/plugin-activation.php and includes/pluginManager.class.php and provided a way to install/uninstall/reinstall plugin through URL.

In RPM post install script we simply use this URL to install/unistall and reinstall depending on our needs.

Revision history for this message
Greg (gregfr) said :

That's clever! I love it when people find elegant way of solving complex problems. Would you consider contributing a little article about that? :)