PHP Classes
elePHPant
Icontem

File: Falcraft/falcraftLoad.php

Recommend this page to a friend!
  Classes of Asher Wolfstein  >  Abstract Data Types  >  Falcraft/falcraftLoad.php  >  Download  
File: Falcraft/falcraftLoad.php
Role: Auxiliary script
Content type: text/plain
Description: File Loader
Class: Abstract Data Types
Set of abstract data types as pure PHP classes
Author: By
Last change:
Date: 3 years ago
Size: 689 bytes
 

 

Contents

Class file image Download
<?php

/**
 * Load PHP Files When Autoloader Doesn't Exist
 *
 * @param array $libraries files to load relative to this file
 * @param string $context the context of the file including
 * @param mixed $refresh refresh the loader contents with another value
 *
 */
function falcraftLoad(array $libraries, $context = 'global', $refresh = false)
{
    foreach (
$libraries as $include ) {
        if (
realpath( __DIR__ . str_replace( '/', DIRECTORY_SEPARATOR, $include ) ) === false )
            throw new \
RuntimeException( "falcraftLoad - $context: include $include not found" );
        require_once(
realpath( __DIR__ . str_replace('/', DIRECTORY_SEPARATOR, $include ) ) );
    }
   
}