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

comments with version info in encoded files

Author Message
sgs



Joined: 08 Mar 2006
Posts: 2
Location: Cornwall, UK

PostPosted: Wed Mar 08, 2006 3:05 pm    Post subject: comments with version info in encoded files Reply with quote

Hi

We use PHPDoc style comments at the top of every PHP file to record, among other, individual file versions.

I need to be able to see what file verion a client has install and would, therefore, ideally like these page level comments included in the preample.

Is there any way I can achive this.

At the very least I need each file to pull across its version from the PHPDoc version. I am having to do this manually at the moment which is a massive pain as the project has 412 files in it!

Cheers
_________________
Steve

Aqua Technologies Limited
www.aqnet.co.uk
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2788

PostPosted: Wed Mar 08, 2006 3:22 pm    Post subject: Reply with quote

You cannot do this yet, however provided that you adopt a proper product release procedure, all that's required is noting which release of your product they have. This is easily doable, and actually better, more relevant and generally more useful than having the particular file version visible as you can see easily which product version is used, and also if a product is some hybrid of product versions.

When you release each revision of your product, a product freeze will associate a symbolic tag with each file revision for that freeze. Different RC systems do this in different ways, but the principle is there in all of them. Having done the freeze, you will have a record of exactly which version of each file is part of that freeze, allowing you in the future to checkout a copy of any prior release of the product, with all the files at the correct revision. In some companies, developers are actually forbidden to build each release of the final product, with this being handled by the QA or UAT team from the frozen code base. This is to ensure that if disaster happens and a product needs to be rebuilt, that an exact replicant of the originally released product can be built, and eliminating the chance of developers slipping in changes under the radar that may get lost on a rebuild.

I'm sure that you're doing this, so given that you have a unique product version/revision for each release that you make, the question is how to get this number into your encoded files. The mechanism for this is header comments. In the Windows GUI, there is a concept of environment variables, and you can allocate a variable for product version. In fact, there's one predefined for that very purpose. In many of the fields, you can use the syntax {variable} to expand the said variable, and in this case, you would put the product version variable as an expansion in the header text field. When you encode your files, you'll then see the product version as a comment at the start of each file.

As an extension to this, the dynamic fields mechanism of the special edition GUI offers additional flexibility. If you put a question mark (?) for the value of an environment variable (and in other fields too), a new pane in the main GUI is dynamically created, with fields that prompt for any values that have a ? in them. In this way, you can avoid having to edit the project configuration to change the version number, and you can enter it directly into the main encoding page just before clicking the encode button. This is great for some fields that really do change on each encoding or license file creation, although for product version it's less clear whether it's appropriate.

For the command line Encoders, you just use the relevant command line option to specify header comments.
_________________
Community Admin
Back to top
View user's profile Send private message
sgs



Joined: 08 Mar 2006
Posts: 2
Location: Cornwall, UK

PostPosted: Wed Mar 08, 2006 3:29 pm    Post subject: Reply with quote

OK, thanks for answering that so promptly.

The main project is actually in CVS and I have adopted a technique similar to that which you have suggested.

I just, as yet, have to find a more graceful way of handling versions of bespoke files for individual client which I dont want to create a new code fork for and was hoping to just use the simple and more manual approach of working from comments.

Is it intended to allow comments through at any stage in the future?
_________________
Steve

Aqua Technologies Limited
www.aqnet.co.uk
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
liaison
ionCube Support


Joined: 16 Dec 2004
Posts: 2788

PostPosted: Wed Mar 08, 2006 3:52 pm    Post subject: Reply with quote

Possibly. It's something that we've discussed in the past, but there are quite a few issues to consider when coming up with a general purpose mechanism.
_________________
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