2017 © Pedro Peláez
 

library wai

Web Application Installer

image

eghojansu/wai

Web Application Installer

  • Wednesday, June 8, 2016
  • by eghojansu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Wai

Web application installer, (*1)

Usage

In your entry file (eg. index.php) add statements like below to get this work., (*2)

<?php

// index.php
// mark file and line to clean
Wai::mark(__FILE__, $lineStart = 6, $lineEnd = 62);

// configuration
$config = [
    // current version
    'version'      => '0.1.0',
    // used for saving installed version and schema, ensure this directory is writable
    'workingDir'   => 'tmp/',
    // schema directory that contains every schema that need to be installed
    // filename should be prefixed by ordered number
    'schemaDir'    => 'app/schema/',
    // argument for constructing PDO class
    'database'     => [
        // dsn, string, without database name
        'dsn'      => 'mysql:host=127.0.0.1',
        // username, string
        'username' => 'root',
        // password, string
        'password' => null,
        // options, array
        'options'  => [],
        // database name
        'dbname'   => 'test_wai',
        // drop db first
        'dropdb'   => false,
    ],
];
Wai::setup($config);

// check if current version is same as installed version
if (Wai::isNotInstalled()) {

    // not installed, install it
    // you can pass array of callback that will be execute
    // before and after database procedure called
    $dir = __DIR__;
    $callbacksBefore = [
        function() use ($dir) {
            chmod($dir.'/tmp', 0777);
        },
        function() {
            // other statements to do
        },
    ];
    $callbacksAfter = [
        function() {
            // other statements to do
        },
    ];
    Wai::handleInstallation($callbacksBefore, $callbacksAfter);
}

// catch result
// $result = Wai::result();

// or write result and exit
Wai::hold();

The Versions

08/06 2016

dev-master

9999999-dev

Web Application Installer

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

installer web application wai

08/06 2016

v0.1.5

0.1.5.0

Web Application Installer

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

installer web application wai

23/05 2016

v0.1.4

0.1.4.0

Web Application Installer

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

installer web application wai

23/05 2016

v0.1.2

0.1.2.0

Web Application Installer

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

installer web application wai

23/05 2016

v0.1.1

0.1.1.0

Web Application Installer

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

installer web application wai

23/05 2016

v0.1.0

0.1.0.0

Web Application Installer

  Sources   Download

The Requires

  • php >=5.4

 

The Development Requires

installer web application wai