Summary: Slight tweak to sample-config.php include_once lines for farm use
Created: 2008-11-05 09:09
Status: Open
Category: Feature
Assigned:
Priority: 1
Version: 2.2.0-beta67
OS: Linux (Ubuntu 2.6.24-19), Windows XP
Description:
INTRO
This is a slight usability tweak to the sample-config.php. This is to address an issue with single quotes in the sample-config.php when used with farms. It is not a bug, but a simple change would avoid a gotcha that users might face.
BACKGROUND
The sample-config.php has several lines that use the include_once feature, most are commented out, they are:
Line#52 # include_once(‘scripts/creole.php’);
Line#104 # if ($action == 'refcount') include_once(‘scripts/refcount.php’);
Line#108 # if ($action == 'rss') include_once(‘scripts/feeds.php’); # RSS 2.0
Line#109 # if ($action == 'atom') include_once(‘scripts/feeds.php’); # Atom 1.0
Line#110 # if ($action == 'dc') include_once(‘scripts/feeds.php’); # Dublin Core
Line#111 # if ($action == 'rdf') include_once(‘scripts/feeds.php’); # RSS 1.0
Line#137 # include_once(‘scripts/urlapprove.php’);
ISSUE
If the user is using farms, he or she will change these lines to from...
include_once(‘
to...
include_once(‘$FarmD/
so for example, the line...
# if ($action == 'rss') include_once(‘scripts/feeds.php’); # RSS 2.0
Should be...
# if ($action == 'rss') include_once(‘$FarmD/scripts/feeds.php’); # RSS 2.0
So that the Farm directory is used. This induces a bug whereby some scripts need this include to be double quotes rather than single quotes. The following two warnings are displayed, and the RSS feed (for example) is not returned. When seeing these warnings and the error the URL was ?action=rss
Warning: include_once($FarmD/scripts/feeds.php) [function.include-once]: failed to open stream: No such file or directory in /var/www/code/ssofb_website/local/farmconfig.php on line 115
Warning: include_once() [function.include]: Failed opening '$FarmD/scripts/feeds.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/code/ssofb_website/local/farmconfig.php on line 115
PLATFORM INFO
OS: Linux (Ubuntu 2.6.24-19)
PmWiki version: 2.2.0-beta67
SOLUTION
The solution to this is simple, to just change the single quotes to doubles. For example the line...
# if ($action == 'rss') include_once(‘scripts/feeds.php’); # RSS 2.0
Should be...
# if ($action == 'rss') include_once(”scripts/feeds.php”); # RSS 2.0
I’ll try and include a patch for this. The contents of the patch would be
Attach:PmWIki_PITS_01055_patch.txt