ionCube Logo
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


 
Post new topic   Reply to topic    ionCube Forum Index -> ionCube Loader

Loader API

Author Message
accessib



Joined: 19 Jul 2007
Posts: 5

PostPosted: Thu Jul 19, 2007 6:48 pm    Post subject: Loader API Reply with quote

Hello,
I plan to use the Encoder Pro to create a license file for my project written in PHP. I would like to check the license file from within the login screen and give a friendly message telling the user there are X number of days left before the license expires. I'm assuming I would have to set license check to manual and then use the loader API. Problem is that I'm not sure how to get the number of days remaining until the expiration of the license file.

Thanks in advance for your help!
Back to top
View user's profile Send private message
cjunge



Joined: 19 Mar 2006
Posts: 25

PostPosted: Mon Jul 23, 2007 11:59 pm    Post subject: Re: Loader API Reply with quote

accessib wrote:
Hello,
I plan to use the Encoder Pro to create a license file for my project written in PHP. I would like to check the license file from within the login screen and give a friendly message telling the user there are X number of days left before the license expires. I'm assuming I would have to set license check to manual and then use the loader API. Problem is that I'm not sure how to get the number of days remaining until the expiration of the license file.

Thanks in advance for your help!

Expose the date that the license expires, then read it using the API and do your calculations on that. Might Need to massage the date to be usable.

Or set your own property with the date in a format you like.

Cameron
Back to top
View user's profile Send private message
accessib



Joined: 19 Jul 2007
Posts: 5

PostPosted: Tue Jul 24, 2007 2:03 am    Post subject: Reply with quote

This is what I did once I realized that I could encode source files with no expiration and require a license file that will expire AND I could still use ioncube_file_info() API to return the expiration date. Here is the code I used in my application. I hope it can help others...

if ($a = ioncube_file_info()){
$license = $a['FILE_EXPIRY'] - time();
$license = ceil($license / 84600);

if ($license <= 30)
$msg = "Your license will expire in ".$license." days. ...";
else
$msg= "License will expire on ".date("F j, Y",$a['FILE_EXPIRY']);
}

print $msg;
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> ionCube Loader All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum