Yii Framework Forum: Strange autoload with evaluateExpression - Yii Framework Forum

Jump to content

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

Strange autoload with evaluateExpression include(backUrl(Yii.php) - failed to open stream Rate Topic: -----

#1 User is offline   Maurycy Zarzycki 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 15-August 12

Posted 27 August 2012 - 05:00 AM

I use CGridView with CButtonColumn and custom buttons. One of the buttons'
URL
contains this string:
backUrl(Yii::app()->createUrl("/game/publishToggle/{$data->id}"))
. Basically it calls a method backUrl() which will return an URL with a parameter which is a reference to the current page, but nevermind that.

The issue is something which happens on my production server - when trying to evaluate this script it throws this weird error:

include(backUrl(Yii.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

I have tracked it down to call to "function_exists()" in CComponent::evaluateExpression(). For some weird reason function_exists believes that "backUrl(Yii" is a name of a class. I have worked around it like this:

$parenthPos = strpos($_expression_, '(');
        
if(is_string($_expression_) && (!$parenthPos || !function_exists($_expression_)))

Certainly that's not all, I should check for all non alpha-numeric characters but for now it suffices.

The PHP version on my server is 5.3.8, display_errors is set to "On". Is that an issue of Yii, something on my end or a PHP oddity?
0

#2 User is offline   resurtm 

  • Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 83
  • Joined: 19-December 10

Posted 27 August 2012 - 05:30 AM

What version of the framework are you using? Try to upgrade to the latest stable 1.1.12.
0

#3 User is offline   Maurycy Zarzycki 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 15-August 12

Posted 27 August 2012 - 05:55 AM

View Postresurtm, on 27 August 2012 - 05:30 AM, said:

What version of the framework are you using? Try to upgrade to the latest stable 1.1.12.

Ah, it fixes this bug, thanks! I didn't realize a new version was released already.
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