Fork me on GitHub
Subscribe 3

Ticket #209 (fixed bug)

Use absolute paths to define PUN_ROOT

  • Created: 2010-12-07 12:48:10
  • Reported by: Pierre
  • Assigned to: Reines
  • Milestone: 1.4.3
  • Component: code
  • Priority: normal

ATM PUN_ROOT is defined as './'. As a result files prefixed with this constant are searched in every path defined in the include_path variable defined in php.ini.

This also makes it impossible to use APC with stat=0 to save a lot of I/O. See

I propose to replace the PUN_ROOT definition with

define('PUN_ROOT', __DIR__.'/');

A simple patch can be found at … ROOT.patch


Reines 2010-12-07 13:01:57

  • Milestone set to 1.4.4.
  • Owner set to Reines.

Hey, Thanks for the report, that is a good point.

For FluxBB 2.0 we will probably start using __DIR__, however the 1.4 branch should still work under PHP 4 and __DIR__ wasn't added until 5.3.0. I guess for the 1.4 branch we could use dirname(__FILE__) instead.

I'll mark this for the 1.4.4 release, as we hope to have 1.4.3 out this week. Though it is a rather easy change so we could possibly push it forward.

Reines 2010-12-07 13:16:03

  • Milestone changed from 1.4.4 to 1.4.3.
  • Status changed from open to fixed.

On second though I've just implemented this now since it's such an easy change, and unlikely to cause any issues (though I'm sure saying that will jinx it now...). … c7cef7c2bc

quy 2011-01-12 00:28:29

Please confirm that in profile.php (lines 297 to 389) that all instances of $pun_config['o_avatars_dir'] should be prefixed with PUN_ROOT.

Reines 2011-01-12 08:39:30

Probably every occurrence of $pun_config['o_avatars_dir'] in profile.php should be.