Skip to content

Instantly share code, notes, and snippets.

@dflima
Created October 17, 2012 19:34
Show Gist options
  • Save dflima/3907621 to your computer and use it in GitHub Desktop.
Save dflima/3907621 to your computer and use it in GitHub Desktop.
Simple autoload function in PHP
<?php
define('RAIZ_DA_APP', dirname(__FILE__));
define('LIB', RAIZ_DA_APP.'/lib');
function meuAutoload($classe){
$d = LIB;
include "{$d}/{$classe}.php";
}
spl_autoload_register('meuAutoload');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment