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

Option to continue in case of encoding error

Author Message
mtassinari



Joined: 17 Oct 2013
Posts: 6

PostPosted: Tue May 12, 2020 8:44 am    Post subject: Option to continue in case of encoding error Reply with quote

Good morning,

I was looking into the docs, but I couldn't find if such an option exists.

Basically, what I would like is, if encryption of a file fails for some reason, it should be copied unencrypted in the target location.

Does such option exist?
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 372

PostPosted: Tue May 12, 2020 10:08 am    Post subject: Reply with quote

Hi,

I guess you mean encoding of PHP files rather than encryption. Is that right?

Why would such functionality be useful? If encoding of a PHP file fails then it means that the file contains invalid PHP (at least for that encoding source language). Therefore if it were copied then you would have an invalid unencoded PHP file in the target.

Furthermore. as encoding would have continued, it would be difficult to spot that encoding on a particular file (or files) had failed.
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
mtassinari



Joined: 17 Oct 2013
Posts: 6

PostPosted: Tue May 12, 2020 10:20 am    Post subject: Reply with quote

alastair wrote:
I guess you mean encoding of PHP files rather than encryption. Is that right?


Yes, sorry, I used the wrong word there.

alastair wrote:
Why would such functionality be useful? If encoding of a PHP file fails then it means that the file contains invalid PHP (at least for that encoding source language). Therefore if it were copied then you would have an invalid unencoded PHP file in the target.


I found myself in a sort of edge case, in which I use PHP 7.0, which has no own encoder, so I encode files with the encoder for PHP 5.6; however, that encoder can fail on files that are actually valid in version 7.0 but not in 5.6.

So, instead of having a missing file in the target folder of the encoding process, I think it'd be preferable to have the file in plain.
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 372

PostPosted: Tue May 12, 2020 11:07 am    Post subject: Reply with quote

Hi,

Thanks for the clarification.

Would it not be better then to use the 7.1 Encoder, especially bearing in mind that PHP 7.0 reached its end of life 16 months ago? Otherwise, with the scheme you are suggesting, you could end up with many files that were unencoded in the target. You would also need to ensure that you did a 7.0 syntax check prior to encoding (with "php7.0 -l") so as to distinguish between "real" syntax issues and those arising from using the 5.6 Encoder.

If you are using bundled encodings (like the "5.6 & 7.1" option in the GUI), your suggestion also means that the second encoder, that would expect to find bundled encoded files, would have to ignore any unencoded file it found.
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
mtassinari



Joined: 17 Oct 2013
Posts: 6

PostPosted: Tue May 12, 2020 11:11 am    Post subject: Reply with quote

alastair wrote:
Would it not be better then to use the 7.1 Encoder, especially bearing in mind that PHP 7.0 reached its end of life 16 months ago?


Yeah, I know, and you're right, it'd be the best thing to do.

As of now we are still in a transition phase, so we still need to support PHP 7.0, with plan to upgrade to PHP 7.4 by the end of the year.

That's why I was asking about such option, but if it's unavailable, I can simply prepare a script which would scan the source folder and copy in the target folder any missing php file.
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 372

PostPosted: Tue May 12, 2020 5:29 pm    Post subject: Reply with quote

Hi,

Unfortunately I do not think we would add such the feature you suggested to a future version of the Encoder because there is too much risk for the unwary. That is, somebody unfamiliar with the Encoder might alight upon such an option and use it to "fix" the problems they were having encoding.
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
mtassinari



Joined: 17 Oct 2013
Posts: 6

PostPosted: Wed May 13, 2020 7:32 am    Post subject: Reply with quote

Yes, I understand, and honestly agree, thanks for the feedback anyway!
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