PHP Classes

File: Falcraft/Features/falcraftLoad.php

Recommend this page to a friend!
  Classes of Asher Wolfstein   PHP Configuration Trait   Falcraft/Features/falcraftLoad.php   Download  
File: Falcraft/Features/falcraftLoad.php
Role: Auxiliary script
Content type: text/plain
Description: Loader for Falcraft
Class: PHP Configuration Trait
Load and save class configuration using a trait
Author: By
Last change: Changed Position in Class
Date: 8 years ago
Size: 514 bytes
 

Contents

Class file image Download
<?php

/**
 * Load PHP Files When Autoloader Doesn't Exist
 *
 */
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 ) ) );
        }
    }
   
}