__DIR__ undefined on php < 5.3

Bug #1015960 reported by Fournier Erwan
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
chive
Fix Released
Medium
David Roth

Bug Description

Chive doesn't work anymore on php version < 5.3

Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /xxx/chive/index.php on line 33

Warning: CApplication::require(__DIR__/protected/config/main.php) [capplication.require]: failed to open stream: No such file or directory in /xxx/chive/yii/base/CApplication.php on line 100

Fatal error: CApplication::require() [function.require]: Failed opening required '__DIR__/protected/config/main.php' (include_path='.:/usr/share/php:/usr/share/pear') in /xxx/chive/yii/base/CApplication.php on line 100

Something like this does the job :

if (!defined('__DIR__'))
 define('__DIR__', dirname(__FILE__));

Related branches

description: updated
David Roth (davrot)
Changed in chive:
status: New → Triaged
milestone: none → 1.2
David Roth (davrot)
Changed in chive:
assignee: nobody → David Roth (davrot)
importance: Undecided → Medium
status: Triaged → Fix Committed
Revision history for this message
selectstar (martinsarsini) wrote :

Same problem here. PHP 5.2.17

David Roth (davrot)
Changed in chive:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.