https://github.com/lookyman/nette-proxy
Integration of https://ocramius.github.io/ProxyManager into Nette Framework
https://github.com/lookyman/nette-proxy
lazy nette proxy
Last synced: 6 months ago
JSON representation
Integration of https://ocramius.github.io/ProxyManager into Nette Framework
- Host: GitHub
- URL: https://github.com/lookyman/nette-proxy
- Owner: lookyman
- License: mit
- Archived: true
- Created: 2016-11-10T15:41:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-12-20T12:43:37.000Z (over 4 years ago)
- Last Synced: 2025-08-30T02:28:27.292Z (10 months ago)
- Topics: lazy, nette, proxy
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 13
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Lookyman/Nette/Proxy
====================
Integration of [Proxy Manager](https://ocramius.github.io/ProxyManager) into [Nette Framework](https://nette.org).
[](https://travis-ci.org/lookyman/nette-proxy)
[](https://scrutinizer-ci.com/g/lookyman/nette-proxy/?branch=master)
[](https://coveralls.io/github/lookyman/nette-proxy?branch=master)
[](https://packagist.org/packages/lookyman/nette-proxy)
[](https://packagist.org/packages/lookyman/nette-proxy)
Installation
------------
### Install
```sh
composer require lookyman/nette-proxy
```
### Config
```yaml
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.
```yaml
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:
```yaml
services:
-
class: DontProxyMeService
tags: [lookyman.lazy: off]
```
Proxying certain Nette services is automaticaly disabled due to [known limitations](https://ocramius.github.io/ProxyManager/docs/lazy-loading-value-holder.html#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](https://github.com/kdyby/console) and run:
```sh
php www/index.php lookyman:nette-proxy:generate
```