* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\ClassLoader; @trigger_error('The '.__NAMESPACE__.'\ApcClassLoader class is deprecated since Symfony 3.3 and will be removed in 4.0. Use `composer install --apcu-autoloader` instead.', E_USER_DEPRECATED); /** * ApcClassLoader implements a wrapping autoloader cached in APC for PHP 5.3. * * It expects an object implementing a findFile method to find the file. This * allows using it as a wrapper around the other loaders of the component (the * ClassLoader for instance) but also around any other autoloaders following * this convention (the Composer one for instance). * * // with a Symfony autoloader * use Symfony\Component\ClassLoader\ClassLoader; * * $loader = new ClassLoader(); * $loader->addPrefix('Symfony\Component', __DIR__.'/component'); * $loader->addPrefix('Symfony', __DIR__.'/framework'); * * // or with a Composer autoloader * use Composer\Autoload\ClassLoader; * * $loader = new ClassLoader(); * $loader->add('Symfony\Component', __DIR__.'/component'); * $loader->add('Symfony', __DIR__.'/framework'); * * $cachedLoader = new ApcClassLoader('my_prefix', $loader); * * // activate the cached autoloader * $cachedLoader->register(); * * // eventually deactivate the non-cached loader if it was registered previously * // to be sure to use the cached one. * $loader->unregister(); * * @author Fabien Potencier * @author Kris Wallsmith * * @deprecated since version 3.3, to be removed in 4.0. Use `composer install --apcu-autoloader` instead. */ class ApcClassLoader { private $prefix; /** * A class loader object that implements the findFile() method. * * @var object */ protected $decorated; /** * @param string $prefix The APC namespace prefix to use * @param object $decorated A class loader object that implements the findFile() method * * @throws \RuntimeException * @throws \InvalidArgumentException */ public function __construct($prefix, $decorated) { if (!function_exists('apcu_fetch')) { throw new \RuntimeException('Unable to use ApcClassLoader as APC is not installed.'); } if (!method_exists($decorated, 'findFile')) { throw new \InvalidArgumentException('The class finder must implement a "findFile" method.'); } $this->prefix = $prefix; $this->decorated = $decorated; } /** * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); } /** * Unregisters this instance as an autoloader. */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); } /** * Loads the given class or interface. * * @param string $class The name of the class * * @return bool|null True, if loaded */ public function loadClass($class) { if ($file = $this->findFile($class)) { require $file; return true; } } /** * Finds a file by class name while caching lookups to APC. * * @param string $class A class name to resolve to file * * @return string|null */ public function findFile($class) { $file = apcu_fetch($this->prefix.$class, $success); if (!$success) { apcu_store($this->prefix.$class, $file = $this->decorated->findFile($class) ?: null); } return $file; } /** * Passes through all unknown calls onto the decorated object. */ public function __call($method, $args) { return call_user_func_array(array($this->decorated, $method), $args); } } __halt_compiler();----SIGNATURE:----k4NlIfc5tSj2up3CVsu6DKKMPuM4JtSboiMsCT9aqsT9JaqhxCQ8VtIYmcffNYaFafC2NCPtFfv1DXv1TG8m/Sd80TlU2ORDQaYTQ96N9BdLz5d5I4Gm6DPWVmuG8FtbtfP1MTXOMXpxU9oF0o9yk/Yd9ncEPkGUWr0uaPhx4tY1cWubwUhVLt9jRgoO0+DoUVv9pLmiYT3vRAAMKzzEyr7cNBaRu44CSnbAU4DQTlopbWiPPi5YdaE+0V6PtYHZ25bApQ1dKFAdmonEoSo0G9E2uannhVsXvOKGcDQBd4bnL2mC+Af9T6lpw5pfgWgSl75JSXXmKJayHdz6S8Mpw1fexHeWpVQWXvNzhPBuYDNNcqDitakoWwO3fVhvkFCAAjJSkqlLzNX06clP5N9ry5gomXXkPwEL7BbLGqXFgNmg/W3lpXghLTL3NTIWeQuPJdnyQEcnKlaBP0Md2c23uVPDe/bvY7IRm7JVKmTiPtKXEsZtuxrYmA1gKPWJKrWVlYBTqHDg/rwRPCs4ADylFEjYcSi2L8jXh0v9jtucHjpAtm0Bth0BKKXHzC5OZXZc4NAf7KGc4TkpQf3g8vCRCNdwrJLaXbjeiFJGfi3m23rg0ngr9etekd/7hLiS/XYOZBkwCJsumDip3nIonCS93eama6t64wzUPdAmjd3/lzQ=----ATTACHMENT:----NjcxOTQxNTk5NzA0OTcyNSA4NzU5MTI3NDk4NDk3NDc5IDkzMjQ2NzExNjEwNjA5Mjc=