Creating a New cPAddon Script
You will first need to create a script compatible with the cPAddons system if you wish for the script to be accessible from the cPanel interface. To view examples of such scripts, see http://httpupdate.cpanel.net/cpanelsync/cpaddons/cPanel/
Assuming we are making a cPAddon for a CMS called "Foo" version 1.0, we would follow these steps:
- Create the working directory, as well as a backup.
mkdir Foo_1.0.work && mkdir Foo_1.0.orig
Foo_1.0.tar.gz into the working directory.
tar xvfz Foo_1.0.tar.gz -C ./Foo_1.0.orig/ && tar xvfz Foo_1.0.tar.gz -C ./Foo_1.0.work/
- Make a directory
Foo.pm and place it into the working directory.
Foo_1.0.work/ here as needed.
- Your goal is to get the files necessary for the install all prepped and together.
- Remove any install scripts and upgrade scripts, as this is all handled via the cPAddons interface.
- Prepare any config files. This entails:
- Set appropriate permissions on all the files (world readable config files and world writable directories will result in a much lower security rating).
Foo/1.0.mysql if needed.
- Note: The
mysql file uses the Config file variables.
- You should also include a use statement at the top. Assuming the
mysql key in the module's
'mysql' => ['foo'],, your
mysql file would start like this:
| USE [% foo %];|
| CREATE TABLE [% table_prefix %]_barbaz (|
Foo_1.0.work/ by issuing the following commands:
tar -cvfz ../Foo/1.0.tar.gz
- The reason we use
cd above is to ensure that the tarball contains the files as they should be in the installation directory.
- Create a file named
Foo/lisc (contains your license verbiage).
- Install on server or distribute through a cPanel Sync server.
Topic revision: r16 - 17 Aug 2011 - 15:26:14 - Main.JustinSchaefer
CpanelAddons.CreatingScripts moved from Sandbox.CreatingScripts on 18 May 2009 - 17:03 by Main.JustinSchaefer