Skip to content

Building the connectors

Brian Teeman edited this page Aug 12, 2023 · 3 revisions

The vast majority of users do not need to build the connectors yourself. It is recommended that you use the pre-built, versioned connectors instead.

Building the connector is only meant for experts, and only in very specific use cases. You should only need to build the connector yourself if you suspect you are affected by a bug which has been resolved in the development branch of the connector's repository, but has not yet made it to a published release. Alternatively, you will need to build the connector yourself if you are working on the code of the connector, e.g. to make a Pull Request for a bug fix or new feature.

Minimum Requirements

To build the connectors you need an environment which meets the following minimum requirements:

  • A terminal (command line) running Bash or Zsh such as WSL2 on Windows, macOS Terminal.app, or the terminal (e.g. Konsole, GTerm, …) of your favourite Linux distribution.
  • The command line binary of PHP 7.4 or later (8.2 recommended) in your path.
  • The command line binary for Git in your path.
  • PHP Composer installed and in your path.

Installing pre-requisites

Before building the connectors you need to install some global Composer dependencies:

composer global require phing/phing
composer global require pear/archive_tar
composer global require pear/versioncontrol_git
composer global require pear/http_request2

Also, make sure that Composer's global vendor/bin folder is in your path. Here's how to do that.

First, find out where Composer puts its global files by running composer global config. This will print out something like:

Changed current directory to /home/myuser/.config/composer

This tells you that Composer uses /home/myuser/.config/composer as the base directory for its global dependencies. Therefore, the vendor/bin folder under it is /home/myuser/.config/composer/vendor/bin.

If you're using bash as your shell (WSL2 using Ubuntu, most Linux distributions) run

echo 'export PATH=$PATH:/home/myuser/.config/composer/vendor/bin' >> ~/.bashrc
source ~/.bashrc

If you are using zsh as your shell (macOS by default) run

echo 'export PATH=$PATH:/home/myuser/.config/composer/vendor/bin' >> ~/.zshrc
source ~/.zshrc

Fetching the repositories

To build the connectors you need to have the working copies of three Git repositories under the same folder:

  • Akeeba BuildFiles https://github.com/akeeba/buildfiles.git in buildfiles
  • Akeeba Panopticon Connector for Joomla https://github.com/akeeba/panopticon-connector in panopticon-connector
  • Akeeba Panopticon Connector for Joomla 3.9 and 3.10 https://github.com/akeeba/panopticon_connector_j3 in panopticon_connector_j3

After cloning the repositories you need to run composer install on each one of them to update the dependencies.

You can do this from the terminal, putting everything in the panopticon-sources directory under your home folder:

mkdir ~/panopticon-sources
cd ~/panopticon-sources
git clone https://github.com/akeeba/buildfiles.git
git clone https://github.com/akeeba/panopticon-connector
git clone https://github.com/akeeba/panopticon_connector_j3
pushd buildfiles
composer install
popd
pushd panopticon-connector
composer install
popd
pushd panopticon_connector_j3
composer install
popd

Building the connectors

You just need to change into the directory of each connector package and run phing. This creates the installable ZIP package in the repository's release directory.

Remember to run git pull and composer install before building each connector. This will ensure you always have a connector built against the latest code and the corresponding, updated dependencies.

Assuming your repository working copies are as described in the previous section, you can do the following from the command line:

cd ~/panopticon-sources
pushd panopticon-connector
git pull
composer install
phing
popd
pushd panopticon_connector_j3
git pull
composer install
phing
popd
Clone this wiki locally