- DocuSign Community
- :
- Dev Zone
- :
- DocuSign API Integration (PHP)
- :
- Re: avoiding class definition collisions
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
avoiding class definition collisions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-09-2012 06:06 PM
My code needs to login and then build/send the envelope programmatically in one request.
Therefore when I include api/Credential.php, and include api/APIService.php
Many of the same classes are defined in both of these files (although they have some different properties), thus it throws a 'cannot redefine' error in php.
How can I work around this?
Thanks
Solved! Go to Solution.
Re: avoiding class definition collisions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-09-2012 09:45 PM
PHP added namespace support so you may be able to do it with that.
I'll ask some folks tomorrow and see if they have other recommendations.
Thanks!
Re: avoiding class definition collisions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-10-2012 10:15 AM
I got it working with namespaces...but I had to instanitate all classes with the namespace path.
new Docusign\Api\Envelope()
new Docusign\Auth\Credential()
etc etc.
Thanks
Re: avoiding class definition collisions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-10-2012 10:17 AM
Very cool. Glad you got it working!
