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 PHP Encoder

encoding skin files

Author Message
greekuser



Joined: 30 Mar 2006
Posts: 2

PostPosted: Thu Mar 30, 2006 11:18 am    Post subject: encoding skin files Reply with quote

i am intrested in creating skin files for an open source application
that uses .tpl for template skin.

the source code in this file is like html.

i am only intrested in encoding one file the index.tpl

is it possible to encode it and have a licence only for one domain

so that if it installed somewhere else it wont work?
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2788

PostPosted: Thu Mar 30, 2006 2:41 pm    Post subject: Reply with quote

It depends. How is the .tpl file read? Presumably it's not read by PHP directly as it's not a PHP file, and so it will be read by a template engine. The Encoder has a feature that can encrypt any files, and the Loader API has a function called ioncube_read_file() that can read encrypted or plain text files and return the contents as a string. If you can modify the template engine in PHP so that it uses our read function, then yes you can do this. Note that then template engine would need to be encoded for this to work. However, if you cannot encode and modify the template engine. and if you just want to protect your skin and pass it to the system that reads the skin and where you have no control over the engine, then you cannot do this because the template engine is not going to know how to decrypt the skin file.
_________________
Community Admin
Back to top
View user's profile Send private message
greekuser



Joined: 30 Mar 2006
Posts: 2

PostPosted: Thu Mar 30, 2006 4:41 pm    Post subject: Reply with quote

ok i see what you mean

its like you said
index.php calls xtpl.php to read the index.tpl

i found where the xtpl.php is located

so what you are saying is that the xtpl.php has to be modified to read
ioncube encoded files, and also be encoded by ioncube.

modifying this files means just add the ioncube_read_file action
or do i have to do more than that?

cause i dont want to copletely modify the file cause i only want the index.tpl to be encoded. there are at list 12 more .tpl files that i dont want to encode, so the xtpl.php must be able to read both types.

to finish i want to ask, does encoded files takes longer to load? and are they search engine friendly?
Back to top
View user's profile Send private message
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2788

PostPosted: Thu Mar 30, 2006 5:17 pm    Post subject: Reply with quote

Hi

You will need to modify and encode xtpl.php, but this will no problem unless you want other people to change it. The fantastic thing about ioncube_read_file() is that it can read and process both encrypted and plain text files! So you get the best of both worlds. The link below is the source of a patch that we made to Smarty, and shows the way to do this and to make it resilient if the Loader isn't installed, although you'll want it to be.

http://www.ioncube.com/resources/encrypted_smarty_patch.phps

_read_file is the name of the function in Smarty that reads template files, you'll have something similar in your code.

So, change your xtpl.php file to use ioncube_read_file() and whatever encryption passphrase you want, encode the file and you're all set. Everything will work as before, and if you choose to encrypt any of your .tpl files, provided that you use the same passphrase, the encrypted versions will work too. It's very cool when this works Smile

For speed, encoded files tend to be faster than original source code if the Loader is in the php.ini file, so you've got another benefit right there. If runtime install is used, the execution performance is still typically faster than source, but there is overhead when PHP links and unlinks the Loader on each request. This isn't noticable to the end user though.

You can see some independent benchmarks that compare unencoded, zend and ionCube performance at

http://www.olate.co.uk/development/benchmarks.php
_________________
Community Admin
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> ionCube PHP Encoder 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