<?php

class Autoload
{

    public function __construct()
    {
        spl_autoload_extensions('.php');
        spl_autoload_register(array($this, 'load'));
    }

    private function load($className)
    {
        $extension = spl_autoload_extensions();
        $classPath = __DIR__ . '/' . str_replace("\\", "/", $className) . $extension;

        if(file_exists($classPath)){
            require_once($classPath);
        }
    }

}