jublo / codebird-php

Easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.
https://www.jublo.net/projects/codebird/php
GNU General Public License v3.0
777 stars 235 forks source link

spl_autoload_register issue #185

Closed edi closed 7 years ago

edi commented 7 years ago

Hello guys!

I just pulled out my hair for about half hour to figure out why the heck would my code be posting the same messages twice or some times even three times, with one single call.

Problem solved after I removed the spl_autoload_register and I've manually required all my classes in.

Any suggestion on how to fix that because I kind of have quite a few classes and I wouldn't want to miss anything in the future.

Thank you!

mynetx commented 7 years ago

@EduardJS You might want to define a constant using define() once you send the message. Later, only post it if the constant is not defined yet.

edi commented 7 years ago

Hello! This has been fixed, it was an anti-pattern issue on my end, pulling a "Mail" method multiple times. There is no issue on Codebird's end. Using it successfully since 👍

mynetx commented 7 years ago

Great to hear! Please note that codebird 3.2 is around the corner.

edi commented 7 years ago

Awesome!