Jump to content

include pear in module


breandan81
 Share

Recommended Posts

Ok, so I am writing a module to email people license keys that I generate. I'm using the open source library truelicense, and the keys are binary files, so I need to send them as attachments. In order to do this more easily I am using the pear Mail and Mail/mime libraries. That's where the problem started. The module has the following functions:

__construct
_displayForm
genkey
getContent
hookupdateOrderStatus
install
sendKey

in order to test it I just made a dummy order paid for with paypal sandbox, and I go to the back office and set the order status to payment accepted to trigger the module.

sendKey is the only one that needs the pear stuff, so it was the one I wrote last. When

include_once('Mail.php');
include_once('Mail/mime.php');

isn't at the top of the file, and sendKey is left blank, the module doesn't send a key, but it does exit just fine and go back to the order screen and the payment status is updated. As soon as I include Mail and Mail/mime, it doesn't return to the order status screen anymore, like the script has an error in it. But the whole module seems to work, I get my key mailed to me as an attachment, I get an email notifying me that someone bought something that required licensing and telling me what commandline was used and where the file was saved, I even added a line to mail me at the end of hookupdateorderstatus that everything was finished, and it gets to there. Is there some trick to this?

licensedistributor.php

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More