Difference: CreatingScripts (14 vs. 15)

Revision 1512 May 2011 - Main.JustinSchaefer

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Creating a New cPAddon Script

Line: 7 to 7
 Assuming we are making a cPAddon for a CMS called "Foo" version 1.0, we would follow these steps:

  1. Create the working directory, as well as a backup.
Changed:
<
<
    • Example: mkdir Foo_1.0.work & mkdir Foo_1.0.orig
>
>
    • Example: mkdir Foo_1.0.work && mkdir Foo_1.0.orig
 
  1. Put Foo_1.0.tar.gz into the working directory.
  2. Untar Foo_1.0.tar.gz into Foo_1.0.orig/ and Foo_1.0.work/
Changed:
<
<
    • tar -xvfz Foo_1.0.tar.gz ./Foo_1.0.orig/ & tar -xvfz Foo_1.0.tar.gz ./Foo_1.0.work/
>
>
    • tar xvfz Foo_1.0.tar.gz -C ./Foo_1.0.orig/ && tar xvfz Foo_1.0.tar.gz -C ./Foo_1.0.work/
 
  1. Make a directory Foo/
    • mkdir Foo
  2. Make Foo.pm and place it into the working directory.
Changed:
<
<
>
>
 
  1. Modify 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:
Changed:
<
<
>
>
 
    • Set appropriate permissions on all the files (world readable config files and world writable directories will result in a much lower security rating).
  1. Create Foo/1.0.mysql if needed.
Changed:
<
<
>
>
 
    • You should also include a use statement at the top. Assuming the mysql key in the module's $meta_info is 'mysql' => ['foo'],, your mysql file would start like this:
      • | USE [% foo %];|
      • | CREATE TABLE [% table_prefix %]_barbaz (|