PHP Classes

File: fox/autoload.php

Recommend this page to a friend!
  Classes of Joubert RedRat   Fox micro framework   ???   Download  
File: fox/???
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Fox micro framework
Model View Controller micro-framework
Author: By
Last change: Update of fox/autoload.php
Date: 2 years ago
Size: 546 bytes
 

 

Contents

Class file image Download
<?php
/**
 * Autolader engine
 *
 * @author Joubert <[email protected]>
 * @license: MIT
 * @see https://github.com/joubertredrat/fox/
 */

namespace Fox;

$composer_autoload = getValidPath(FOX_PATH, '..', 'vendor', 'autoload.php');
if (
file_exists($composer_autoload)) {
    require(
$composer_autoload);
}

spl_autoload_register(function ($class) {
    if (
strpos($class, __NAMESPACE__.'\\Model\\') === 0) {
       
$name = substr($class, strlen(__NAMESPACE__.'\\Model\\'));
        require(
getValidPath(MODEL_PATH, $name.'.php'));
    }
});