[ Index ] |
PHP Cross Reference of phpBB-3.2.11-deutsch |
[Summary view] [Print] [Text view]
1 --TEST-- 2 Verifies that lazy loading value holder proxy file is generated 3 --FILE-- 4 <?php 5 6 require_once __DIR__ . '/init.php'; 7 8 class Kitchen 9 { 10 private $sweets = 'candy'; 11 } 12 13 $configuration->setProxiesTargetDir(__DIR__ . '/cache'); 14 $fileLocator = new \ProxyManager\FileLocator\FileLocator($configuration->getProxiesTargetDir()); 15 $configuration->setGeneratorStrategy( 16 new \ProxyManager\GeneratorStrategy\FileWriterGeneratorStrategy($fileLocator) 17 ); 18 19 $factory = new \ProxyManager\Factory\LazyLoadingValueHolderFactory($configuration); 20 21 $proxy = $factory->createProxy('Kitchen', function (& $wrapped, $proxy, $method, array $parameters, & $initializer) { 22 $initializer = null; 23 $wrapped = new Kitchen(); 24 }); 25 26 $filename = $fileLocator->getProxyFileName(get_class($proxy)); 27 var_dump(file_exists($filename)); 28 29 $proxy = $factory->createProxy('Kitchen', function (& $wrapped, $proxy, $method, array $parameters, & $initializer) { 30 $initializer = null; 31 $wrapped = new Kitchen(); 32 }); 33 34 var_dump(file_exists($filename)); 35 @unlink($filename); 36 37 ?> 38 --EXPECT-- 39 bool(true) 40 bool(true)
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Nov 11 20:33:01 2020 | Cross-referenced by PHPXref 0.7.1 |