PHP Classes
elePHPant
Icontem

File: tests/bootstrap.php

Recommend this page to a friend!
  Classes of Jorge Castro  >  PHP State Machine One  >  tests/bootstrap.php  >  Download  
File: tests/bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP State Machine One
Process transitions in a state machine
Author: By
Last change:
Date: 11 months ago
Size: 603 bytes
 

 

Contents

Class file image Download
<?php


   
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\\statemachineone\\", __DIR__ . '/../lib/'));
   
spl_autoload_register(create_autoloader("eftec\\tests\\", __DIR__ . '/'));