PHP Classes

File: src/bootstrap.php

Recommend this page to a friend!
  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: Update of src/bootstrap.php
Date: 5 months 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;
    }
}