Componette

Componette

RadekDvorak

RadekDvorak / nette-proxy-service

Lazy services for Nette Framework

download-cloud-line composer require radekdvorak/nette-proxy-service

#Nette Proxy Generator# This Nette Framework extension allows you to hide services in proxy classes. Seldom used yet still initialized services are hidden, eventual expensive object initiation is postponed. The real service class gets instantiated as soon as the proxy class property or method is accessed.

##Instructions##

  • Have composer install the source code
composer.phar require radekdvorak/nette-proxy-service:0.*
  • Enable the extension in your neon config
extensions:
	proxyService: NetteProxyService\DI\ProxyServiceExtension
  • Configure directory for proxy class cache
proxyService:
	cacheDir: some/directory
	# disable in production
	autogenerateProxyClasses: true
  • Tag selected services with proxyService.lazy (the prefix depends on the extension registration name)

  • Setup an autoloader for the cacheDir (see RobotLoader if you are not sure what to do)

##Notes:##

  • This extension is quite new therefore consider it a bit experimental

No release at this moment. Try to create first one.

bar-chart-fill

Statistics

download-cloud-fill
13
star-fill
0
bug-fill
0
flashlight-fill
9.1y
price-tag-2-line

Badges

guide-fill

Dependencies

php (>=5.3.1)
nette/di (~2.2)
Componette Componette felix@nette.org