XF 2.3 Need some help with the installer

Rene_V

New member
I am trying to develop an add on. I've been reading Let's build an add-on# in the Developer Documentation section and following the instructions mentioned there I ran the cmd.php through the terminal. I added all the add ons basic info and so far so good. For Does your Setup need to support running multiple steps? (y/n) y I entered n because I assumed that y would have been if was planning to add multiple stuff to the database. I wanted to add only a custom table. My Setup.php file had a different function name for the install method.

public function install(array $stepParams = []) as opposed to public function installStep1() as mentioned in the example of the aforementioned section. I added the code that adds the custom table in the database and saved the changes. I noticed that the table I wanted to add wasn't present in the database. According to the example running the following command should do it. php cmd.php xf-addon:install-step Demo/Portal 1

I ran it, I replaced the example name with the actual name/class of my app, but I got the following error:

Setup class does not have a installStep1() method.

That made sense to me because my Setup.php file didn't have the installStep1 method in it. So I tried to run the following command: php cmd.php xf-addon:install Demo/Portal and I got the following message.

This add-on is already installed. Please upgrade it instead.

Can someone tell me what the correct command would be to add the custom table in the database? Your help will be much appreciated.
 
I changed the function name for the install to public function installStep1() as mentioned in the example at the Developer Documentation, ran the advised command and voilà my table was added to the database. Now to figure out the rest.
 
Back
Top Bottom