Plugin Documentation

A gPHPEdit plugin is a script that gPHPEdit will list in the menu and allow you to integrate somewhat with the editor. The files must be executable by the current user and will be listed under the Plugins menu using the filename you gave it (so feel free to use spaces/capital letters in the filenames). There are a limited number of things a plugin will receive from gPHPEdit and a limited number of things it can return.

The plugins should be stored either in /usr/share/gphpedit/plugins/ if you want them to be available for all users on your machine or in ~/.gphpedit/plugins/ if you only want them to be available for the current user.

In version 0.9.50 the number of plugins available is limited to 10. User specific plugins take preference over global plugins if the number is over 10.

How it works

The general mechanism for interacting with a plugin is as follows:

* gPHPEdit runs your script/plugin with a command line parameter of -type
* Your plugin must print one of the following types to STDOUT:
  o SELECTION - your plugin requires the current selection of text or nothing if none is selected
  o NO-INPUT - your plugin doesn't require anything
  o FNAME - your plugin requires the current full filename (local files only)
* When the menu item is clicked, gPHPEdit runs your plugin with either the selection or the filename in single quotes.
* Your plugin must then print to STDOUT one of the following actions:
  o INSERT - your plugin requires that the gPHPEdit inserts the text that is about to be returned at the cursor position (i.e. after any current selection)
  o REPLACE - your plugin requires that the gPHPEdit replaces any current selection with the text that is about to be returned
  o OPEN - your plugin requires that gPHPEdit opens the file that is about to be specified (NB: this can be the same as the file specified inwards with FNAME, this will reload the current file)
* The next thing your plugin must print is a newline character
* Finally your editor should print either the content or the filename, then close

Examples

For some example plugins, view our plugin samples page. If you wish to submit your plugins for use on this site, please email them to plugins at gphpedit dot org with some introductory information. We will only host plugins licensed under the GPL, so please confirm that in your email.