findFile() публичный Метод

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
Результат string | null
Пример #1
0
 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');
 }
Пример #2
0
 /**
  * @dataProvider getLoaderTests
  */
 public function testFindFile($className, $location)
 {
     $loader = new ApcClassLoader(md5(__DIR__), new Nsautoload());
     $file = $loader->findFile($className);
     $this->assertSame(realpath($file), realpath($location));
 }