Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration:: setAutoGenerateProxies() deprecated #137

Closed
mnapoli opened this issue Jan 8, 2014 · 4 comments
Closed

Configuration:: setAutoGenerateProxies() deprecated #137

mnapoli opened this issue Jan 8, 2014 · 4 comments
Labels

Comments

@mnapoli
Copy link

mnapoli commented Jan 8, 2014

Since 0.5, Configuration::setAutoGenerateProxies() is deprecated: https://github.com/Ocramius/ProxyManager/blob/master/src/ProxyManager/Configuration.php#L64

Does that mean that it's always true now? I.e., proxies are auto-generated when missing? (that's what I got from the code, but I wanted to be sure, the deprecation message is not explicit)

@mnapoli mnapoli mentioned this issue Jan 8, 2014
20 tasks
@Ocramius
Copy link
Owner

Ocramius commented Jan 8, 2014

@mnapoli yes, correct - always auto-generated as a fallback. That of course means that your app could as well cause a lot of I/O if you used the file writer generator and no proper autoloading, but that's a minor thing compared to a major failure.

@mnapoli
Copy link
Author

mnapoli commented Jan 8, 2014

OK thanks. Just to be sure, when you say "and no proper autoloading", this kind of configuration should be correct then:

$config = new Configuration();

if ($this->writeProxiesToFile) {
    $config->setProxiesTargetDir($this->proxyDirectory);
    spl_autoload_register($config->getProxyAutoloader());
} else {
    $config->setGeneratorStrategy(new EvaluatingGeneratorStrategy());
}

return new LazyLoadingValueHolderFactory($config);

(PHP-DI)

@Ocramius
Copy link
Owner

Ocramius commented Jan 8, 2014

Yes, that would do the trick

@mnapoli
Copy link
Author

mnapoli commented Jan 8, 2014

awesome thanks!

@mnapoli mnapoli closed this as completed Jan 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants