PHP Classes

File: tests/bootstrap.php

Recommend this page to a friend!
  Classes of Jorge Castro  >  BladeOne  >  tests/bootstrap.php  >  Download  
File: tests/bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: BladeOne
Standalone template engine that compiles into PHP
Author: By
Last change: Update of tests/bootstrap.php
Date: 1 month ago
Size: 846 bytes
 

 

Contents

Class file image Download
<?php
/*
 * Require the composer autoloader or create PSR-4 autoloaders for eftec\bladeone\ and eftec\tests\ found in composer.json.
 */

if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
    require_once
__DIR__ . '/../vendor/autoload.php';
} else {
    function
create_autoloader($prefix, $base_dir) {
        return function (
$class) use ($prefix, $base_dir) {
            if (
strncmp($prefix, $class, strlen($prefix)) !== 0) {
                return;
            }

           
$file = $base_dir . str_replace('\\', '/', substr($class, strlen($prefix))) . '.php';

            if (
file_exists($file)) {
                require
$file;
            }
        };
    }

   
spl_autoload_register(create_autoloader("eftec\\bladeone\\", __DIR__ . '/../lib/'));
   
spl_autoload_register(create_autoloader("eftec\\tests\\", __DIR__ . '/'));
}


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