Previous page

Next page

Locate page in Contents

Print this page

Packaging WordPress Application

WordPress is a personal publishing platform designed to ease web blog management. The application is built on PHP and MySQL and licensed under the GPL. It is designed to be installed on dedicated web server or shared hosting account and desktop. The most up-to-date version of Wordpress is 3.0, and the approximate package size is 7Mb. Web blog can be localized and delivered in a language at customer choice. Every installation of WordPress comes with a file editor one can use to edit templates and other WordPress related files, right in a browser without having to worry about downloading and uploading the files in order to edit them.

Note: above information is taken from application vendor home page.

Listed below are the sections of an APP-META.xml file supplied with your package:

  1. Type of environment. The application vendor states that WordPress can be installed on shared hosting. So, we can draw a conclusion that WordPress is a multi-instance application.
  2. Model of service provisioning. The application is managed by one user 'admin' with all privileges. It is not possible to create more then one user 'admin' within one application instance. A number of users with restricted set of privileges can be added under the 'admin'. All data is shared between users and web blog appearance depends only on 'admin' user preferences. So, WordPress is a single-tenant or simple application and application files are simply copied to location dedicated to customer.
  3. Services hierarchy. WordPress provides only one service - web blog management. Let's write down it in the Specification terms:
    <service id="blog">
  4. Used technologies. WordPress requires PHP version 4.3. or greater and MySQL version 4.0 or greater. Let's write down it in the Specification terms:
      <requirements xmlns:php="http://apstandard.com/ns/1/php"
                    xmlns:db="http://apstandard.com/ns/1/db">
       <php:version min="4.2.0"/>
       <php:extension>mysql</php:extension>
       <php:safe-mode>false</php:safe-mode>
       <db:db>
        <db:id>main</db:id>
        <db:default-name>wordpress</db:default-name>
        <db:can-use-tables-prefix>false</db:can-use-tables-prefix>
        <db:server-type>mysql</db:server-type>
        <db:server-min-version>4.0.0</db:server-min-version>
       </db:db>
      </requirements>
  5. Presentation details and settings. We defined earlier that WordPress provides one service - web blog management. Application requires the following settings on installation: 'admin' user login, password and e-mail address, web blog title and language choice. These settings appear in the Control Panel as text fields (or, in some Control Panels, as text areas for settings with min-length attribute set to 200 or above). Let's group these settings for better presentation, and write down it in the Specification terms:
    <settings>
     <group>
      <name>Administrator's preferences</name>
      <setting id="admin_name" type="string" 
             default-value="admin" min-length="1"
             max-length="32" regex="^[a-zA-Z][0-9a-zA-Z_\-]*">
       <name>Administrator's login</name>
       <error-message>Please make sure the text you entered starts
                     with a letter and continues with either numbers,
                    letters, underscores or hyphens.
       </error-message>
      </setting>
      <setting id="admin_password" type="password" min-length="1" >
       <name>Password</name>
      </setting>
      <setting id="admin_email" type="email">
       <name>Administrator's email</name>
      </setting>
     </group>
     <group>
      <name>Weblog's preferences</name>
      <setting id="title" type="string" min-length="1">
       <name>Weblog title</name>
      </setting>
     </group>
     <group>
      <name>Other preferences</name>
      <setting id="locale" type="enum" default-value="en-US">
       <name>Interface language</name>
       <choice id="en-US" >
        <name>English</name>
       </choice>
       <choice id="de-DE" >
        <name>German</name>
       </choice>
      </setting>
     </group>
    </settings>
  6. Content delivery method. WordPress is a simple application and should be accessible via Internet. So, delivery method is Inside package and URL mapping rules should be declared. Let's write down URL mapping rules and specify required amount of disk space in the Specification terms:
    <provision>
     <url-mapping>
      <default-prefix>wordpress</default-prefix>
      <installed-size>6696960</installed-size>
      <mapping url="/" path="htdocs" 
               xmlns:php="http://apstandard.com/ns/1/php">
       <php:handler>
        <php:extension>php</php:extension>
       </php:handler>
       <mapping url="blogs/media">
        <php:permissions writable="true"/>
       </mapping>
       <mapping url="wp-content">
        <php:permissions writable="true"/>
       </mapping>
       <mapping url="tmp">
        <php:permissions writable="true"/>
       </mapping>
      </mapping>
     </url-mapping>
    </provision>
  7. Draft of metadata file. Now, it is time to make a draft of the application metadata file. Describe application general information in the Specification terms. For details, refer to the 5.1 Common Application Properties section of the Specification. Begin with adding general information:
    <id>http://wordpress.org/</id>
    <name>WordPress</name>
    <version>3.0</version>
    <release>5</release>

    And then add information written down on previous steps and replenish it with details.

  8. Configuration script. Write configuration script that performs application installation, configuration and removal, using environment variable defined on the previous steps. Configuration script should perform all actions required for application configuration. For the list of environment variables, refer to the Sample Environment Variables section further in this guide.

    Add information about script to the provision section of the metadata file. For example,

    <configuration-script name="configure">
     <script-language>php</script-language>
    </configuration-script>
  9. Archiving application. Form application package according URL mapping rules defined and requirements in the 4. Basic Package Format section of the Specification and archive it. In our case, the structure is the following:

APP-META.xml

# Metadata container. XML file.

scripts/

 

configure

# This script will be invoked when application instance is to be setup.

images/

 

icon.png

admin_page.jpg

# Icon and screenshots of the application

htdocs/

 

blogs/

...

index.php

...

# WordPress files

See Also

Packaging Scenarios

Packaging SugarCRM Application

Packaging Open-Xchange Application

Packaging German Translation Add-on for WordPress

Packaging SpamExperts Incoming Email Security Firewall Application

Packaging Applications with Upsell Services

Please send us your feedback on this help page