$config = ClassLoader::getIncludes(function (ClassLoader $loader) { global $clazzLoader; $clazzLoader = $loader; require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php'; $loader->register(); function assertClass($loader, $name) { if (!$loader->loadClass($name)) { throw new Exception("unable to load class: {$name}"); } } assertClass($loader, '\\PurchasedAt\\Signing\\JWT'); assertClass($loader, '\\PurchasedAt\\Signing\\JWTOptions'); assertClass($loader, '\\PurchasedAt\\Constants'); assertClass($loader, '\\PurchasedAt\\Validation\\Check'); assertClass($loader, '\\PurchasedAt\\Validation\\Preconditions'); assertClass($loader, '\\PurchasedAt\\Validation\\Verify'); assertClass($loader, '\\PurchasedAt\\Purchase\\Customer'); assertClass($loader, '\\PurchasedAt\\Purchase\\Payload'); assertClass($loader, '\\PurchasedAt\\Purchase\\Response'); assertClass($loader, '\\PurchasedAt\\Purchase\\Select'); assertClass($loader, '\\PurchasedAt\\Purchase\\Test'); assertClass($loader, '\\PurchasedAt\\Purchase\\Transaction'); assertClass($loader, '\\PurchasedAt\\Purchase\\CheckoutItem'); assertClass($loader, '\\PurchasedAt\\Purchase\\Checkout'); assertClass($loader, '\\PurchasedAt\\PurchaseScript'); assertClass($loader, '\\PurchasedAt\\PurchaseOptions'); assertClass($loader, '\\PurchasedAt\\APIClient'); assertClass($loader, '\\PurchasedAt\\APIRequest'); assertClass($loader, '\\PurchasedAt\\APIResponse'); assertClass($loader, '\\PurchasedAt\\APIResult'); assertClass($loader, '\\PurchasedAt\\API\\Customer'); assertClass($loader, '\\PurchasedAt\\API\\CheckoutItem'); assertClass($loader, '\\PurchasedAt\\API\\Checkout'); assertClass($loader, '\\PurchasedAt\\API\\Item'); assertClass($loader, '\\PurchasedAt\\API\\Price'); assertClass($loader, '\\PurchasedAt\\API\\RedirectData'); assertClass($loader, '\\PurchasedAt\\API\\Transaction'); assertClass($loader, '\\PurchasedAt\\API\\TransactionNotification'); assertClass($loader, '\\PurchasedAt\\API\\SessionEntryUrl'); });
<?php define('BASE_PATH', dirname(__DIR__)); use ClassPreloader\ClassLoader; require_once BASE_PATH . '/vendor/classpreloader/classpreloader/src/ClassLoader.php'; $config = ClassLoader::getIncludes(function (ClassLoader $loader) { $loader->register(); }); $files = (include BASE_PATH . '/config/compile.php'); foreach ($files as $file) { if (file_exists($file)) { $config->addFile($file); } } return $config;
<?php use ClassPreloader\ClassLoader; $appDir = dirname(dirname(dirname(__DIR__))); $config = ClassLoader::getIncludes(function (ClassLoader $loader) use($appDir) { $loader->register(); $app = (require $appDir . '/bootstrap/instance.php'); (new \BEAR\Package\Dev\Application\ApplicationReflector($app))->compileAllResources(); }); // Add a regex filter that requires that a class does not match the filter $config->addExclusiveFilter('/Doctrine\\/Common\\/Annotation/')->addExclusiveFilter('/FirePHP/')->addExclusiveFilter('/PHPParser_*/')->addExclusiveFilter('/Smarty*/')->addExclusiveFilter('/TokenParser/')->addExclusiveFilter('/My.Hello\\/Resource/')->addExclusiveFilter('/AdapterTrait/'); return $config;