Reply
Super DocuSign User
zorfius
Posts: 34
Registered: ‎02-07-2012
Accepted Solution

avoiding class definition collisions

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

 

 

DocuSign Guru
vladcretu
Posts: 505
Registered: ‎01-06-2012

Re: avoiding class definition collisions

 

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!

Super DocuSign User
zorfius
Posts: 34
Registered: ‎02-07-2012

Re: avoiding class definition collisions

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

DocuSign Guru
vladcretu
Posts: 505
Registered: ‎01-06-2012

Re: avoiding class definition collisions

Very cool. Glad you got it working!