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

Puli Factory is not available #38

Closed
nWidart opened this issue Jan 4, 2016 · 15 comments
Closed

Puli Factory is not available #38

nWidart opened this issue Jan 4, 2016 · 15 comments

Comments

@nWidart
Copy link

nWidart commented Jan 4, 2016

Hello,

I'm using the Happyr/LinkedIn-API-client package, which has recently been updated to use PSR-7.

Since the update I'm getting the following error:

[RuntimeException]             
Puli Factory is not available

This happens in the ClassDiscovery class on getPuliFactory method.

When going to https://github.com/puli/factory, I see it's not maintained anymore.

Anything I missed ?

@sagikazarmark
Copy link
Member

For the time being you need to install puli/cli. Either the PHAR in your prefix or the package in your application. This should change soon and discovery will require puli/cli.

@sagikazarmark
Copy link
Member

See #39

@dbu
Copy link
Contributor

dbu commented Jan 4, 2016

this is fixed if you require php-http/discovery: "^0.6.2"

@dbu dbu closed this as completed Jan 4, 2016
@nWidart
Copy link
Author

nWidart commented Jan 4, 2016

Thank you for the quick answer.
I've required version 0.6.2.

However I'm now getting this error:

[Http\Discovery\NotFoundException]                                                                                        
  No factories found. To use Guzzle or Diactoros factories install php-http/message and the chosen message implementation.  

 [Http\Discovery\NotFoundException]                        
  Resource of type "Http\Message\MessageFactory" not found

From the message I assume I have to install php-http/message, but not sure what is ment by the implementation. Which one are there, which one should I pick?

Thank you,

@sagikazarmark
Copy link
Member

Try installing 0.6.2 discovery (version override should work with the linkedin client. @Nyholm could update the required discovery version)

@sagikazarmark
Copy link
Member

You have to install php-http/message to use Guzzle or Diactoros factories and the chosen message implementation package.

@dbu
Copy link
Contributor

dbu commented Jan 4, 2016

if i am not mistaken, requiring one of the adapters in your project is enough. composer require php-http/guzzle6-adapter should pull in php-http/message and everything else you need. at least this is what the tutorial at http://docs.httplug.io/en/latest/httplug/tutorial.html claims.

@nWidart
Copy link
Author

nWidart commented Jan 4, 2016

Oh ok strange, I already had the guzzle6-adapter(version 0.3.1), but php-http/message was missing. Requiring php-http/message, seems to be working now.

Thanks for the help!

@sagikazarmark
Copy link
Member

I think message should not be a dependency of guzzle6 adapter. The library doesn't need it internally. If you want to use message factories in your application, you need to install the dependencies. Discovery can be a dependency, where the client needs to discover a message factory, but implementations should still be installed manually.

@dbu
Copy link
Contributor

dbu commented Jan 4, 2016

okay. i think we still need to work on the documentation to make it easily understandable what you need to require in which situation. and @Nyholm will need to update his documentation or add something to the changelog, if its not already there.

@sagikazarmark if discovery is mainly for zero-config clients, would it make sense to have it require message? or should a library that uses the message factories do that itself? the later probably makes most sense. http://docs.httplug.io/en/latest/httplug/library-developers.html#messages should elaborate a bit more

@sagikazarmark
Copy link
Member

By default, message provides some message factories. In a DI context you need to configure them and inject to the class using it. Discovery provides a zero-config way to find any installed message factories.

Also, discovery is most likely used by your library, while the implementation should be installed in the application.

Yes, we need better documentation for that.

@d4rkd0s
Copy link

d4rkd0s commented May 15, 2016

Per the docs... I ran this command and produced the following error.
php composer.phar require happyr/linkedin-api-client:dev-master php-http/httplug:v1.0.0-beta

Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for php-http/httplug v1.0.0-beta -> satisfiable by php-http/httplug[v1.0.0-beta].
    - Conclusion: remove php-http/promise v1.0.0
    - php-http/httplug v1.0.0-beta requires php-http/promise ^0.1 -> satisfiable by php-http/promise[v0.1.0, v0.1.1].
    - Can only install one of: php-http/promise[v1.0.0, v0.1.0].
    - Can only install one of: php-http/promise[v1.0.0, v0.1.1].
    - Installation request for php-http/promise (installed at v1.0.0) -> satisfiable by php-http/promise[v1.0.0].


Installation failed, deleting ./composer.json.

@sagikazarmark
Copy link
Member

How is your problem related to this issue?

Per what docs?

HTTPlug is already stable, the referred package requires it, so I wonder where you found such an installation command.

@garak
Copy link

garak commented Oct 29, 2018

I'm using php-http/discovery: 1.4.0 and getting this error 😞

@d4rkd0s
Copy link

d4rkd0s commented Oct 30, 2018

@sagikazarmark this was a while back, it looks like things are fixed now. My fault for not posting the link to the docs 😖 it was somewhere in here: http://docs.php-http.org/en/latest/index.html you can disregard my previous comment. I'm no longer using this lib.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants