<?php spl_autoload_register(function($className) { $parts = explode('\\', $className); if(!isset($parts[0]) || $parts[0] != 'GuzzleHttp') return; array_shift($parts); $path = dirname(__FILE__) . '/src/'.implode('/' , $parts) . ".php"; if(file_exists($path)) require_once $path; });