Exemple #1
0
<?php

/**
 * @package  DiamondMVC
 * @author   Zyr <*****@*****.**>
 * @version  1.0
 * @license  CC-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
 */
defined('DIAMONDMVC') or die;
function autoloadFields($class)
{
    if (strToLower(left($class, 5)) !== 'field') {
        return;
    }
    require_once jailpath(DIAMONDMVC_ROOT . '/classes/fields', strToLower(substr($class, 5)) . '.php');
}
AutoloadRegistry::instance()->registerAutloader('autoloadFields');
Exemple #2
0
/**
 * Fallback autoloader. Immitates the behavior of spl_autoload_register.
 * Do not register this function itself!
 * @param string $class Class to load.
 */
function __autoload($class)
{
    AutoloadRegistry::instance()->invokeRegisteredAutoloaders($class);
}
Exemple #3
0
<?php

/**
 * @package  DiamondMVC
 * @author   Zyr <*****@*****.**>
 * @version  1.0
 * @license  CC-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
 */
defined('DIAMONDMVC') or die;
function autoloadEvents($class)
{
    if (strToLower(right($class, 5)) !== 'event') {
        return;
    }
    require_once jailpath(DIAMONDMVC_ROOT . '/classes/events', strToLower(substr($class, 0, strlen($class) - 5)) . '.php');
}
AutoloadRegistry::instance()->registerAutloader('autoloadEvents');