bluelinecity.com

Pis

The easy way to install a script

The PHP Installation System is an abstract class which can be used to create a web-based installation script. It provides all the basic interface tools of gathering configuration information from the user while allowing the author to perform all PHP commands throughout the installation process.

PIS takes care of all the overhead and lets you concentrate on installing your script!

Installing a script shouldn’t be complicated. This script addresses that.

Code Example

Below is an example of an installation class extended from the PHP Installation System.

class MyInstaller extends PIS {

  function page_welcome(){		

    $this->message('Welcome to my installer');

    $this->message('The next pages will guide you through '.
      'the installation process.');
  }

  function page_test(){

    $this->test(is_writable('config.php'),
		'config file is not writable');
  }

  function page_config(){

    $this->title("Configuration Options");

    $this->input('text','db_host',array(
	   'required' => true,
	   'label' => 'Database Host',
	   'help' => 'Commonly localhost.',
	   ));
  }

  function page_install(){
    if ( mysql_connect( $this->get('db_host') ) ){
       $this->message("Successfully Connected");
    } else {
       $this->message("Installation Failed");
    }
  }
}