PHP Classes

File: bin/bootstrap.php

Recommend this page to a friend!
  Classes of Michael Cummings   PHP Create UUID v4 type   bin/bootstrap.php   Download  
File: bin/bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP Create UUID v4 type
A custom Doctrine data type for UUID v4 values
Author: By
Last change:
Date: 4 years ago
Size: 1,160 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.
 */
/** @noinspection ClassConstantCanBeUsedInspection */
if (\class_exists('\Composer\Autoload\ClassLoader', false)) {
    return
0;
}
/*
 * Find Composer auto loader after striping away any vendor path.
 */
$path = \str_replace('\\', '/', \dirname(__DIR__, 1));
$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);
/** @noinspection ClassConstantCanBeUsedInspection */
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);
}