PHP code example of corpus / autoloader

1. Go to this page and download the library: Download corpus/autoloader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

corpus / autoloader example snippets




use Corpus\Autoloader\Psr0;
use Corpus\Autoloader\Psr4;

// PSR-0 Autoloader
spl_autoload_register( new Psr0('/vendor/path/blah') );

// PSR-4 Autoloader
spl_autoload_register( new Psr4('My\\Prefix', '/vendor/path/blah') );