Yii Framework Forum: Strange behavior of Yii, when the code is encoded ionCube - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Strange behavior of Yii, when the code is encoded ionCube Rate Topic: -----

#1 User is offline   Stepan Selyuk 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 26-January 10

Posted 03 August 2012 - 12:39 PM

Hi!

When the project is encoded using ioncube works incorrectly binding parameters to the action ($ var1 = 22, $ var2 = null) - if you call a controller action with no parameters, then an error is "invalid request".

Encoding is carried out the project with default settings ioncube. Maybe someone knows, which is why this is happening?
0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,312
  • Joined: 17-January 09
  • Location:Russia

Posted 03 August 2012 - 02:27 PM

I guess that has something to do with reflection + ionCube issues. I've personally never encoded my projects so can't be sure.

Try using $_GET['param'] instead of action's $param and remove parameter itself.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#3 User is offline   Stepan Selyuk 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 26-January 10

Posted 03 August 2012 - 04:21 PM

View Postsamdark, on 03 August 2012 - 02:27 PM, said:

I guess that has something to do with reflection + ionCube issues. I've personally never encoded my projects so can't be sure.

Try using $_GET['param'] instead of action's $param and remove parameter itself.


I checked, this problem occurs only if the ReflectionParameter()->isDefaultValueAvailable() is used from an external unencrypted code that is out of the framework.

I also coded framework and the problem disappeared. A change in the $_GET the whole project really do not want :)
0

#4 User is offline   ionCube 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 05-August 12

Posted 05 August 2012 - 09:21 AM

View PostStepan Selyuk, on 03 August 2012 - 04:21 PM, said:

I checked, this problem occurs only if the ReflectionParameter()->isDefaultValueAvailable() is used from an external unencrypted code that is out of the framework.

I also coded framework and the problem disappeared.


This is related to how the PHP engine implements default parameter reflection. There's no meta data holding details of default parameters for reflection purposes, so to obtain default parameter details, the PHP engine has to resort to what is arguably a kludge of scanning the compiled bytecode to find the necessary information from the v'machine instructions related to parameter passing. ionCube compiled bytecode is protected, so the regular PHP engine bytecode searching fails when it encounters ionCube compiled code due to it not being understood. The ionCube Loader for processing encoded files contains an execution engine designed to ensure that the reflection operations on default values *are* able to work on encoded files, which is why the behaviour works as expected when the calling code was encoded.

--
ionCube
1

#5 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,312
  • Joined: 17-January 09
  • Location:Russia

Posted 06 August 2012 - 08:32 AM

ionCube
Thanks for explaination and welcome to our forums!
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#6 User is offline   egulhan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 22-May 12

Posted 20 September 2012 - 06:47 AM

View PostStepan Selyuk, on 03 August 2012 - 04:21 PM, said:

I checked, this problem occurs only if the ReflectionParameter()->isDefaultValueAvailable() is used from an external unencrypted code that is out of the framework.

I also coded framework and the problem disappeared. A change in the $_GET the whole project really do not want :)


I've the same problem. Can you explain more about your solution?
Php web deleloper
0

#7 User is offline   Stepan Selyuk 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 26-January 10

Posted 20 September 2012 - 06:54 AM

View Postegulhan, on 20 September 2012 - 06:47 AM, said:

I've the same problem. Can you explain more about your solution?


Just encode to ioncube framework folder too.
0

#8 User is offline   egulhan 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 22-May 12

Posted 20 September 2012 - 08:37 AM

View PostStepan Selyuk, on 20 September 2012 - 06:54 AM, said:

Just encode to ioncube framework folder too.


Thanks Stepan. It works.
Php web deleloper
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users