[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/ocramius/proxy-manager/docs/ -> tuning-for-production.md (source)

   1  ---
   2  title: Tuning the ProxyManager for production
   3  ---
   4  
   5  ## Tuning the ProxyManager for production
   6  
   7  By default, all proxy factories generate the required proxy classes at runtime.
   8  
   9  Proxy generation causes I/O operations and uses a lot of reflection, so be sure to have
  10  generated all of your proxies **before deploying your code on a live system**, or you
  11  may experience poor performance.
  12  
  13  You can configure ProxyManager so that it will try autoloading the proxies first.
  14  Generating them "bulk" is not yet implemented:
  15  
  16  ```php
  17  $config = new \ProxyManager\Configuration();
  18  $config->setProxiesTargetDir(__DIR__ . '/my/generated/classes/cache/dir');
  19  
  20  // then register the autoloader
  21  spl_autoload_register($config->getProxyAutoloader());
  22  ```
  23  
  24  Generating a classmap with all your proxy classes in it will also work perfectly.
  25  
  26  Please note that all the currently implemented `ProxyManager\Factory\*` classes accept
  27  a `ProxyManager\Configuration` object as optional constructor parameter. This allows for
  28  fine-tuning of ProxyManager according to your needs.


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1