PHP Classes
elePHPant
Icontem

File: src/bootstrap.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Giovanni Ramos  >  PDO4You  >  src/bootstrap.php  >  Download  
File: src/bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PDO4You
Access SQL databases using the PDO extension
Author: By
Last change: Updated installation scripts
Date: 1 year ago
Size: 885 bytes
 

Contents

Class file image Download
<?php

// Disable XDebug
if (function_exists('xdebug_disable')) {
   
xdebug_disable();
}

define('DEFAULT_LOADER', '../../../vendor/autoload.php');
define('COMPOSER_LOADER', __DIR__ . '/../vendor/autoload.php');
define('INSTALL', '' . __DIR__ . '/../install.sh');
putenv('DIRECTORY='. __DIR__ . '/../');

// AUTOLOADER
if (file_exists(COMPOSER_LOADER)) {
   
$loader = require COMPOSER_LOADER;
} else {
    if (!
file_exists(DEFAULT_LOADER)) {
        if (!isset(
$_GET['install'])) {
            echo
'<h1>AUTOLOADER NOT FOUND</h1>';
            echo
'<h2>To continue the installation, click <a href="?install">INSTALL</a> and wait, or run <i>install.sh</i> from the command line.</h2>';
            exit;
        } else {
           
$output = shell_exec(INSTALL);
            exit(
"<pre>{$output}</pre>");
        }
    } else {
       
$loader = require_once DEFAULT_LOADER;
    }
}