Website releases made easy with the PEAR installer

download Website releases made easy with the PEAR installer

If you can't read please download the document

Transcript of Website releases made easy with the PEAR installer

iBuildings v2

Website releases made easy with the PEAR installer

Helgi ormar orbjrnsson

Tuesday, February 26, 2008

Who Am I ?

An Icelandic guy with a weird name

iBuildings UK

PEAR Group member

PEAR Developer among other things, the installer

pear.php.net maintainer

PEAR ;-)

How to pronounce my name

ormar orbjrnsson being my last name

ASCII version being Thormar Thorbjoernsson

= Th and pronounced like That or a Thorn

Now you are more enlightened about this Icelandic thing called Thorn

Alternative, not a replacement

Deploying websites with the PEAR installer is an alternative, not a replacement for other approaches.

Other alternatives

FTP Upload

SCP / rsync

Capistrano

SVN / CVS / deployment

etc etc etc

PEAR Installer features to the rescue

Easy upgrading

Custom tasks

Post installation tasks

PEAR Installer features to the rescue

Custom file roles

Ability to depend on a PEAR installable packages

Easy to split websites into smaller parts and give each part their own release cycle

Last but not least

Tasks, custom file roles and so on are done with something we are familiar with ....

What is required

The PEAR Installer

Knowledge how to package your code with the installer

A bit of know how and RTFM skills

And not being afraid to read the source ;-)

Dismantling your site

Split your site into logical pieces

Do not split into as many packages as you can!

Micro management is bad, mmmmkay

Dismantling your site

Each piece of site has its own package.xml file

The website it self (the core package) has its own package.xml which all the split off pieces will depend on

Dismantling your site

Website

Web Services

Backend

Frontend

Forum

The packages we get

Website

Website_Frontend

Website_WebServices

Website_Backend

Website_Forum

Custom file roles

This feature allows you to write your own file roles

PEAR supports php, test, data, www and src by default

People have written their own file roles for various whacky reasons:

In relation to templates

Custom handling of data files

Just to name few

Post installation tasks

Handy feature for all the family

Write a simple PHP task that you can run after the installation

Clean up after the installation, temp dirs or similar

DB setup / upgrade tool

vhost adding / updating

Prime Caches

And just about anything you can dream up

Need to know about post install

We do not run post install script auto!

Quick output what it looks like to have a post install script around

pear/pearweb has post-install scripts:/usr/share/PEAR/pearweb.phppearweb: Use "pear run-scripts pear/pearweb" to finish setup.DO NOT RUN SCRIPTS FROM UNTRUSTED SOURCES

Post install task

askdb yesno Install database? yesno y

Post install task

pear run-scripts pear/pearwebIncluding external post-installation script "/usr/share/PEAR/pearweb.php" - any errors are in this scriptInclusion succeededrunning post-install script "pearweb_postinstall->init()"init succeeded

Update pearweb database? [y] :

Post install task

Add more task:param to tasks:paramsgroup so the user gets more questions / prompts per task

Has the ability to skip a param group based on user input

task:type currently has 3 different types\

string

password

yesno

Update pearweb database? [y] : 1. Database driver : mysqli 2. Database User name : pear 3. Database password : pear 4. Database host : localhost 5. Database name : pear

1-5, 'all', 'abort', or Enter to continue:

Real world example

http://cvs.php.net/pearweb/package.xml

http://cvs.php.net/pearweb/package-pepr.xml

http://cvs.php.net/pearweb/pearweb.php

In package.xml look for pearweb.php and you see how we do it for pear.php.net

Good place to study how things are built up

Puzzling the pieces together

Now we run these pseudo packages and we want to install only part of our website structure

pear install alldeps Website_WebServices Website_Frontend Website_Backend

This will install your only those 3 parts of your website along site all the deps which one of those is the Website.

Puzzling the pieces together

Web Services

Backend

Frontend

Website

Questions?

http://c7y.phparch.com (Look for my articles)http://pear.php.net/manual/en/http://www.packtpub.com/PEAR-Installer/book

[email protected]

Resources

Tuesday, February 26, 2008

Ibuildings - http://www.ibuildings.com