BingAds / BingAds-PHP-SDK

Other
56 stars 45 forks source link

Namespaces issues #18

Closed angeorg closed 7 years ago

angeorg commented 7 years ago

Some of the classes are called with lowercase namespaces but they should be called with uppercase namespaces. This is causing fatal errors on Linux where you can have directories with the same name but with different capital letters, e.g. v11 and V11.

Example case:

PHP Fatal error: Uncaught Error: Class 'Microsoft\BingAds\v11\CustomerManagement\GetUserRequest' not found in /vendor/microsoft/bingads/samples/v11/CustomerManagementHelper.php:44

The reason for this error is that CustomerManagement (in the samples code) is calling GetUserRequest class with v11 namespace ("use Microsoft\BingAds\v11\CustomerManagement\GetUserRequest"), instead of V11 namespace ("use Microsoft\BingAds\V11\CustomerManagement\GetUserRequest"). Repacling v11 with V11 resolves the issue. Also having two v11 and V11 directories in the samples folder is confusing.

eric-urban commented 7 years ago

Thanks very much for reporting this issue! I'll have to go back and understand how we ended up with the lowercase v11 directory. (In my clone I didn't see it.) In any case we have updated all to uppercase V11.