PHP Classes

Error instaling with composer

Recommend this page to a friend!

      PHP WSDL Generator  >  All threads  >  Error instaling with composer  >  (Un) Subscribe thread alerts  
Subject:Error instaling with composer
Summary:Cannot get the package with composer
Messages:6
Author:Diego Queiroz
Date:2016-04-11 13:29:04
 

  1. Error instaling with composer   Reply   Report abuse  
Picture of Diego Queiroz Diego Queiroz - 2016-04-11 13:29:04
Ive tried to install via composer and got this error above:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for phpclasses/php2wsdl >=0.5 -> satisfiable by phpclasses/php2wsdl[0.5].
- phpclasses/php2wsdl 0.5 requires wingu/reflection ~1.0 -> no matching package found.

Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

My composer.json:

{
"require":
{
"phpclasses/php2wsdl": ">=0.5"
},
"repositories":
[
{
"type": "composer",
"url": "https:\/\/www.phpclasses.org\/"
},
{
"packagist": false
}
]
}

I set the auth.json with the password php classes gave to me.

Im doing something wrong or the package is damaged?

Thanks!

  2. Re: Error instaling with composer   Reply   Report abuse  
Picture of Protung Dragos Protung Dragos - 2016-04-11 13:34:33 - In reply to message 1 from Diego Queiroz
You can install it from packagist.org

I do not know exactly what phpclasses repo does to dependencies.

  3. Re: Error instaling with composer   Reply   Report abuse  
Picture of Diego Queiroz Diego Queiroz - 2016-04-11 17:29:33 - In reply to message 2 from Protung Dragos
Thanks, work perfect.

But now i have the message
Class 'PHPClass2WSDL' not found

I included the class in my application, but did not found the class, why?

  4. Re: Error instaling with composer   Reply   Report abuse  
Picture of Protung Dragos Protung Dragos - 2016-04-11 21:02:44 - In reply to message 3 from Diego Queiroz
Make sure you included all files, or use composer autoloader to so so.

Also make sure you added the the classes to your "use" namespaces.

  5. Re: Error instaling with composer   Reply   Report abuse  
Picture of Diego Queiroz Diego Queiroz - 2016-04-13 21:39:35 - In reply to message 4 from Protung Dragos
Hi man,

Sorry for asking you again, but i did that on my script:

<?php

require __DIR__ . '/vendor/autoload.php';

$class = "myclass.php";
$serviceURI = "http://localhost:8888/web-service/wsdl";
$wsdlGenerator = new PHPClass2WSDL($class, $serviceURI);
$wsdlGenerator->generateWSDL(true);
$wsdlXML = $wsdlGenerator->dump();

?>

I missed something?
The first line is not enough to load autoload?

Thanks for help again!

  6. Re: Error instaling with composer   Reply   Report abuse  
Picture of Protung Dragos Protung Dragos - 2016-04-14 08:03:21 - In reply to message 5 from Diego Queiroz
You forgot to import the namespace.

The class PHPClass2WSDL is under the PHP2WSDL namespace.

So the code should be

$wsdlGenerator = new PHP2WSDL\PHPClass2WSDL($class, $serviceURI);


I updated my example as well

 
For more information send a message to info at phpclasses dot org.