Aborting plugin installation.

Creating and modifying plugins.
Post Reply
Trixtan

Aborting plugin installation.

Post by Trixtan » Wed May 04, 2005 8:27 pm

Hi!
I am building up a plugin.
I need to some check in the

Code: Select all

install()
method, and I wish to "abort" the installation if something is wrong. Is it suffices to use the return true/false statement???

Thanks!

Trix

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Aborting plugin installation.

Post by garvinhicking » Wed May 04, 2005 9:39 pm

There is no simple "return false" mechanism.

You can however access $this->instance_id to deletethe plugin from the serendipity_plugins table, resp. use the serendipiy_plugin_api::remove_plugin_instance() (or sth like that) method.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Guest

Post by Guest » Thu May 05, 2005 12:32 am

Great... I think I will do in that way.

But... a thing, how can I send the user a response, informing him that something has gome wrong???

Thank you.

P.S. I have fiinshed the first part of my plugin! Tomorrow I will post a topic informing everybody on wath kind of plugin is (anyway it is nothing special).

Trix

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Thu May 05, 2005 1:11 pm

Well, the current only way is to just "echo" the information. We are trying to improve Serendipity in this regard in future versions.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Trixtan

Post by Trixtan » Thu May 05, 2005 1:15 pm

I have tryed, but echo function doesn't work for me if I put in the install() method to alert the user that something was wrong :-( . . .
Well... no problem anyway. I will return on this problem after the big work will be finished.

Post Reply