Page 1 of 1

Aborting plugin installation.

Posted: Wed May 04, 2005 8:27 pm
by Trixtan
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

Re: Aborting plugin installation.

Posted: Wed May 04, 2005 9:39 pm
by garvinhicking
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

Posted: Thu May 05, 2005 12:32 am
by Guest
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

Posted: Thu May 05, 2005 1:11 pm
by garvinhicking
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

Posted: Thu May 05, 2005 1:15 pm
by Trixtan
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.