XF 2.2 Installation of custom addon

chris p

Member
The addon installation documentation was missing some detail I'd like to clarify before I make a mistake that might mess up our current implementation of xenForo. My environment is that we have two dev systems. The first is the general implementation of XF which others are modifying for cosmetics and additional menu widgets that relate to our entire site. When ready, this system will be cloned to become our production system. The second dev system is the one I've been using to create our Threaded View addon (an option but also necessity to the bulk of our users who have difficulty following chronologically ordered forum software). I don't want to mess up the work others have done and have to reload XF on the main dev system.

I've finished this addon per the instructions in the documentation. I see how to package it with cmd.exe and can move it over to the primary dev system where it appears an archive access mode needs enabling in config.php. The docs mention using Cpanel to place the unzipped addon into the appropriate directory where the Admin CP can see and operate on it. I use CLI and the Admin CP. I don't have access via any GUI file manager which I presume is what cpanel is.

Question 1: Is there an alternate CLI oriented command that will for sure correctly place the files where they must be for the addon installation to go smoothly? I'm looking for something like

"sudo bash; cp -Rpn ~me/myunzippedaddon/<something> src/addons/<something>"

I don't need the details, just need source and destination directories so Admin CP can see them and do any magic it needs to do.

Question 2: The second question is, once/if the Admin CP recognizes my archive files, will the enabled-archive installation process automatically do the class extensions, template changes, event listeners, and db alterations from Setup.php (run it)? The docs don't specifically say these will be done (it's directed to end user forum admins).

The answers to these questions determine whether it would be safer just to run through the process (I documented in detail while building the addon), over again on the main dev system (since I am certain that will work at the cost of a few hours).
 
If you have the zip extension for PHP, you can enable the automatic installer in your config file:
PHP:
$config['enableAddOnArchiveInstaller'] = true;

You will see an install button on the top right of the control panel add-ons page, which you can press to select the file produced by the build command. Otherwise you will want to unzip it and copy the contents of the upload/ directory to the root of your installation.
 
If you have the zip extension for PHP, you can enable the automatic installer in your config file:
PHP:
$config['enableAddOnArchiveInstaller'] = true;

You will see an install button on the top right of the control panel add-ons page, which you can press to select the file produced by the build command. Otherwise you will want to unzip it and copy the contents of the upload/ directory to the root of your installation.
Then you are saying I don't need to put things in the right path if I load with the archive installer enabled. Just point it to the path where I copy in the zip I created with the addon export.

Does the archive installer then do the magic necessary such as Class Extensions and Event Listener setup that I had to do while building the addon? I would have guess so since that would be a nightmare for a admin level user to figure out. But I wanted to make certain everything would just work before I tamper with the dev system others are doing their changes on.

Thanks very much for your response.
 
Yeah, you upload the archive directly from your computer to the control panel, so there's no need to copy it to the server first at all. When using the build command, the build includes everything associated with the add-on, including class extensions, event listeners, templates, phrases, permissions, options, etc.
 
Top Bottom