lookyman / nette-proxy
Integration of Proxy Manager into Nette Framework
Installs: 19 309
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- nette/di: ^2.4
- nette/php-generator: ^2.6|^3.0
- ocramius/proxy-manager: ^2.0
Requires (Dev)
- kdyby/console: ^2.6
- nette/bootstrap: ^2.4
- phpunit/phpunit: ^5.6
Suggests
- kdyby/console: For pre-generating proxies via a command
This package is auto-updated.
Last update: 2024-05-04 15:58:56 UTC
README
Integration of Proxy Manager into Nette Framework.
Installation
Install
composer require lookyman/nette-proxy
Config
extensions: proxy: Lookyman\Nette\Proxy\DI\ProxyExtension proxy: proxyDir: %appDir%/../temp/proxies # this is the default value default: off # turn on to proxy everything
Usage
Tag services with lookyman.lazy
and they get magically proxied.
services: - class: MyHeavyService tags: [lookyman.lazy]
If you have proxy.default
turned on and you don't want a particular service to be proxied, you can do it like this:
services: - class: DontProxyMeService tags: [lookyman.lazy: off]
Proxying certain Nette services is automaticaly disabled due to known limitations.
Pre-generating proxies
Proxy generation causes I/O operations and uses a lot of reflection, so it is handy to have them pre-generated before the application starts. For this, install Kdyby/Console and run:
php www/index.php lookyman:nette-proxy:generate