PHP Classes

File: tests/bootstrap.php

Recommend this page to a friend!
  Classes of Jorge Castro   PHP AMP Page Generator   tests/bootstrap.php   Download  
File: tests/bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP AMP Page Generator
Generate HTML for using as Google AMP site
Author: By
Last change:
Date: 3 years ago
Size: 604 bytes


Class file image Download

function create_autoloader($prefix, $base_dir) {
        return function (
$class) use ($prefix, $base_dir) {
            if (
strncmp($prefix, $class, strlen($prefix)) !== 0) {

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

            if (
file_exists($file)) {

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