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

Missing include for TypeDefinitions.inc with PSR0 #8

Open
mattiasgeniar opened this issue Oct 31, 2013 · 4 comments
Open

Missing include for TypeDefinitions.inc with PSR0 #8

mattiasgeniar opened this issue Oct 31, 2013 · 4 comments

Comments

@mattiasgeniar
Copy link

It's been touched on on your blog as well: http://vadimcomanescu.wordpress.com/2013/03/19/vmwarephp-vsphere-api-bindings-for-php/comment-page-1/#comment-30

If you install \Vmwarephp via the following Composer:

{    
    "require": {
        "vmwarephp/vmwarephp": "dev-master"
    },
    "autoload": {
        "psr-0": {
            "Vmwarephp" : "vendor/vmwarephp/vmwarephp/library"
        }
    },
    "minimum-stability": "dev"
}

And you the try to use:

$vhost = new \Vmwarephp\Vhost(...);

you get the following error:

  [Vmwarephp\Exception\Soap]                                  
  Client: Class 'RetrieveServiceContentResponse' not found. 

I've solved it (ugly?) by including the necessary file within my usages:

require_once 'vendor/vmwarephp/vmwarephp/library/Vmwarephp/TypeDefinitions.inc';

After which it works. Could it be PSR0 autoloading isn't working as expected?

Also, the example in the readme for including the package in composer isn't working as I had to explicitly specify the PSRO autoloader to point to the correct 'libraries' directory - isn't the default naming either 'src' or 'lib'?

Let me know if I can help troubleshoot this further.

Thanks,
Mattias

@rgrwkmn
Copy link

rgrwkmn commented Oct 31, 2013

I had the same problem with this and assumed I had done something wrong. I just told Composer where to find the classmap and since then haven't bothered trying to find out if there is another way this should work.

@mattiasgeniar
Copy link
Author

What configs did you give Composer to make this work?

@rgrwkmn
Copy link

rgrwkmn commented Oct 31, 2013

Not sure why it wouldn't pick it up just by requiring it with composer, but I added the vmwarephp path to the classmap. Here is an example composer.json: https://gist.github.com/rgrwkmn/7254857

@ThreepE0
Copy link

ThreepE0 commented Aug 4, 2017

thanks rgrwkmn, that worked for me after running composer update

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

3 participants