<?php

spl_autoload_register(function ($class_name) {
    $classes = explode('\\', $class_name);
    if (empty($classes) || $classes[0] !== 'Axioma') {
        return;
    }
    $classes[0] = 'include';
    foreach ($classes as &$part) {
        $part = ltrim(strtolower(preg_replace('/[A-Z]([A-Z](?![a-z]))*/', '_$0', $part)), '_');
    }
    $path = implode(DIRECTORY_SEPARATOR, $classes) . '.inc.php';
    if (file_exists($path)) {
        require_once($path);
    }
}
);

if (!function_exists('_')) {
    function _($message)
    {
        return $message;
    }
}
