Symfony\Component\ClassLoader\ApcClassLoader::findFile PHP Method

findFile() public method

Finds a file by class name while caching lookups to APC.
public findFile ( string $class ) : string | null
$class string 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;
    }

Usage Example

 public function testConstructor()
 {
     $loader = new ClassLoader();
     $loader->addPrefix('Apc\\Namespaced', __DIR__ . DIRECTORY_SEPARATOR . 'Fixtures');
     $loader = new ApcClassLoader('test.prefix.', $loader);
     $this->assertEquals($loader->findFile('\\Apc\\Namespaced\\FooBar'), apcu_fetch('test.prefix.\\Apc\\Namespaced\\FooBar'), '__construct() takes a prefix as its first argument');
 }
All Usage Examples Of Symfony\Component\ClassLoader\ApcClassLoader::findFile