mediatoolkit / activecampaign-v3-php

Active Campaign v3 PHP Wrapper
MIT License
23 stars 52 forks source link

Client Class not found #15

Open razorsharpshady opened 4 years ago

razorsharpshady commented 4 years ago

First of all thank you for making this wrapper. The issue that I'm facing is which ever class object I'm trying to intialize from the sdk I get the class not found error except for the Client.php class. The issue can be resolved by matching the directory name and the class namespace. e.g namespace Mediatoolkit\ActiveCampaign\Contacts; should be namespace Mediatoolkit\ActiveCampaign\contacts;

namespace Mediatoolkit\ActiveCampaign\Deals; should be namespace Mediatoolkit\ActiveCampaign\deals;

orcinus commented 4 years ago

It's actually the other way around - the folder names should match the classes. deals should be renamed to Deals, contacts should be renamed to Contacts, etc.

That's the way every package and router under the sun works.

My guess is the authors of the library were using it on Windows, Mac (case-insensitive HFS+) or a similar non-case-sensitive filesystem/environment.

mrweiner commented 4 years ago

I added a patch to https://github.com/mediatoolkit/activecampaign-v3-php/issues/13 to address the dir naming/PSR-4 compliance issue that's causing this.