PHP Classes

File: bin/bootstrap.php

Recommend this page to a friend!
  Classes of Michael Cummings  >  PHP Doctrine Person Table Skeleton  >  bin/bootstrap.php  >  Download  
File: bin/bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Doctrine Person Table Skeleton
Provides a skeleton of tables for person entities
Author: By
Last change:
Date: 2 months ago
Size: 1,049 bytes
 

 

Contents

Class file image Download
<?php
declare(strict_types=1);
/**
 * Contains Bootstrap.
 *
 * PHP version 7.2+
 *
 */
/*
 * Nothing to do if Composer auto loader already exists.
 */
if (\class_exists('\Composer\Autoload\ClassLoader', false)) {
    return
0;
}
/*
 * Find Composer auto loader after striping away any vendor path.
 */
$path = \str_replace('\\', '/', \dirname(__DIR__));
$vendorPos = \strpos($path, 'vendor/');
if (
false !== $vendorPos) {
   
$path = \substr($path, 0, $vendorPos);
}
$path .= '/vendor/autoload.php';
/*
 * Turn off warning messages for the following include.
 */
$errorReporting = \error_reporting(E_ALL & ~E_WARNING);
/** @noinspection PhpIncludeInspection */
include_once $path;
\
error_reporting($errorReporting);
unset(
$errorReporting, $path, $vendorPos);
if (!\
class_exists('\Composer\Autoload\ClassLoader', false)) {
   
$mess = 'Could NOT find required Composer class auto loader. Aborting ...';
    if (
'cli' === PHP_SAPI) {
        \
fwrite(STDERR, $mess);
    } else {
        \
fwrite(STDOUT, $mess);
    }
    unset(
$mess);
    exit(
1);
}


For more information send a message to info at phpclasses dot org.