Mantis

Wrote a plugin

Posted by nurikabe 
Wrote a plugin
September 30, 2007 10:12PM
Love the plugin manager. I've written a plugin that I'd like to contribute. How do I package it up?
Re: Wrote a plugin
September 30, 2007 11:47PM
You must create two files: install_inc.php and package_inc.php in the plugin directory.

install_inc.php: this file is used to install/upgrade/remove the plugin (example: install_inc.php).

package_inc.php: this file is used by the packager to create the archive (example: package_inc.php).

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Wrote a plugin
October 01, 2007 12:03AM
Got it, but clicking "Submit" on the pacakger spits out some garbled text. eg:

xÚå[Y“ªÈ¶þ+'êá¾TÄÞ€ÖÞR7DÁ¡”I etc.

This is the .pkg file? Any thing I need to do to force this to download as binary?

Thanks!
Re: Wrote a plugin
October 01, 2007 08:29AM
Quote
nurikabe
Got it, but clicking "Submit" on the pacakger spits out some garbled text. eg:

xÚå[Y“ªÈ¶þ+'êá¾TÄÞ€ÖÞR7DÁ¡”I etc.

This is the .pkg file? Any thing I need to do to force this to download as binary?

Thanks!

Yes I think this is the .pkg file. Which internet browser do you use?

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Wrote a plugin
October 01, 2007 10:08AM
You can try by changing the line 103 in the plugins_package_page.php file (not tested):

before:
Language: PHP
span class="br0">( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Content-Type: text/plain; name=&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; . $t_plugin . &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;-&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; . $t_info[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;version&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] . &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;.mantis.pkg&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; );
after:
Language: PHP
span class="br0">( &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;Content-Type: application/octet-stream; name=&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; . $t_plugin . &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;-&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; . $t_info[&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;version&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;] . &<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>;.mantis.pkg&<a href="http://bugtracker.morinie.fr/mantis/view.php?id=039" target="_blank">#039</a>; );

I&#039;ll add a bug on the bugtracker to fix this issue.

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Wrote a plugin
October 02, 2007 04:15AM
Thanks; will try now. I&#039;m in Firefox.
Re: Wrote a plugin
October 02, 2007 06:32AM
Odd, no luck in either IE or Firefox. Something about the headers (or some whitespace?) is confusing the browsers.

Or.. maybe I need to make a setting change on the server.

Will investigate tomorrow.
Re: Wrote a plugin
October 06, 2007 04:35AM
Found the problem. There was some white space (a couple of extra CR/LF) at the end of this included file:

include( $t_plugin_directory . &#039;package_inc.php&#039; );

that was causing the headers not to output. Removed the whitespace and it works fine.



Edited 1 time(s). Last edit at 10/06/2007 05:26AM by nurikabe.
Re: Wrote a plugin
October 06, 2007 09:51AM
OK, thanks for the info.

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Wrote a plugin
October 25, 2007 09:28PM
Hi,

I am trying to get some information on how to get started with plugin development for Mantis. Can I get some pointers please.

Thanks,
Prabhu S
Re: Wrote a plugin
October 25, 2007 10:43PM
Hi,

I&#039;ve written a page in the Wiki. Tell me what type of plugin you want to write (something that change the Mantis behaviour like HTMLmail or BBCode, something that add new functions like Search, Reminder, Hierarchy...).

You can start with an existing plugin.

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Wrote a plugin
October 25, 2007 11:47PM
Vincent - Thanks for your replyI have seen the Wiki page already. I am basically trying to integrate CVS and Mantis. I am trying to provide additional functionality to Mantis by adding a page where a release manager can add a new branch for a release, specify who can work using that branch etc., I am right in looking at writing a plugin for this purpose?
Re: Wrote a plugin
October 26, 2007 08:48AM
Quote
prabhusr_80
Vincent - Thanks for your replyI have seen the Wiki page already. I am basically trying to integrate CVS and Mantis. I am trying to provide additional functionality to Mantis by adding a page where a release manager can add a new branch for a release, specify who can work using that branch etc., I am right in looking at writing a plugin for this purpose?

Yes it is possible to write a plugin. You probably want to know what you need to write in what file, isn&#039;t it?

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Wrote a plugin
October 31, 2007 04:07PM
Yes Vincent. Missed to notice this reply of yours. I am looking for this information. Also, I do not see how I can generate the package files using the Plugin manager. I installed version 0.1.2 of the Plugin manager. Will updgrate to 0.1.3 meanwhile.
Re: Wrote a plugin
October 31, 2007 04:19PM
Quote
prabhusr
Yes Vincent. Missed to notice this reply of yours. I am looking for this information. Also, I do not see how I can generate the package files using the Plugin manager. I installed version 0.1.2 of the Plugin manager. Will updgrate to 0.1.3 meanwhile.

Stop don&#039;t upgrade (there are too much bugs in the new release).

I&#039;ll add information about the files in the Wiki tomorrow. The plugin manager uses the install_inc.php and package_inc.php files to create a packages (these files must be located into your plugin directory). You can find files examples in the Wiki.

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Wrote a plugin
October 31, 2007 04:44PM
Sure Vincent. I ll hold the upgrade. I ll check the examples and get back to you if there are any queries. can you throw some light on how to create the .pkg file?
Re: Wrote a plugin
October 31, 2007 05:02PM
Quote
prabhusr
Sure Vincent. I ll hold the upgrade. I ll check the examples and get back to you if there are any queries. can you throw some light on how to create the .pkg file?

Let&#039;s take an example winking smiley

Copy/paste the content of this page (I mean only the PHP code) in a package_inc.php file located into the the bbcode plugin directory (if you don&#039;t have the plugin BBCode you can use the pluginmanager directory).

Then browse the plugins_page.php with you favorite browser. In this page you have a part named Package a plugin, select a plugin and then click on submit. Normally you are prompted to save a .pkg file.

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Wrote a plugin
March 07, 2008 11:25AM
Good day Vincent,

I&#039;m using PluingManager 0.2.1 with a Mantis1.1.1.

My problem is that the drop down list in the "Package a plugin" section is empty. And there is only one drop down list.

Is it normal?

Thank you for your excellent work.

Gil
Re: Wrote a plugin
March 07, 2008 11:47AM
Do you have defined an info.php file in your plugin?

Vincent


Mantis: 1.1.0, 1.1.5, 1.1.1
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux

Please complete your signature with your environment informations.
Enable skype notification here
Re: Wrote a plugin
March 07, 2008 12:07PM
No i didn&#039;t.

I&#039;ve just created one following the same structure as the plugin manager&#039;s info.php file.

The good news are that the ddl is now filed with my plugin. And it does create the .pkg file.

However, it seems that i still have some errors to remdiate. I&#039;ll certainly post more messages. :-)

Thanx
Sorry, only registered users may post in this forum.

Click here to login



Online Users

Guests: 12
Record Number of Users: 1 on April 02, 2023
Record Number of Guests: 115 on November 09, 2023
Top Users
Hébergeur : Morinie.Fr