<?php 

namespace BookWellAB;

if(!defined( 'ABSPATH' )){
	exit;
}

spl_autoload_register(function ($class){
	$prefix = 'BookWellAB\\';
    $base_dir = BOOKWELLAB_CLASSES_PATH;
    $len = strlen($prefix);
    if (strncmp($prefix, $class, $len) !== 0) {
        return;
    }
    $relative_class = substr($class, $len);
    $file = $base_dir . 'class.' . strtolower($relative_class) . '.php';
    if (file_exists($file)) {
        require $file;
    }
});
