[horde] Registry calls fail within an SSI included file

Christoph Freundl Christoph.Freundl at informatik.uni-erlangen.de
Fri Jun 15 08:37:39 UTC 2007


Hi,

I want to use the Kronolith API to embed calendar events on a webpage. 
The basic page layout is built using Server Side Includes (and there 
is no way getting rid of it as the layout is "prescribed"). Within the 
pages I can call php scripts using the SSI #include directive.

Consider the two files horde.php and horde.shtml attached below. The 
php file is just taken from the Horde Wiki page "LegacyApps". When I 
call the horde.php script directly from a web browser, the output is 
just what you expect. But when you open the shtml page, weird 
characters appear. From what I tried, this happens also with other 
registry calls, so the problem is not restricted to the Kronolith API. 
I used Horde 3.1.4, Kronolith 2.1.5, Apache 2.2.3 and tried with PHP 
5.1.2 and 5.2.0.

I am a beginner in using the Horde APIs but somewhat experienced in 
PHP, so I dived into the Horde code and tracked down the problem down 
to the call of "call_user_func_array" in Registry::callByPackage. Due 
to my limited experience I do not know whether this is a more general 
PHP problem, an Apache SSI issue, or if it is specific to Horde. 
However, including the call.php script attached below in a shtml page 
works fine.

Maybe someone can explain this behaviour or at least can try to 
reproduce it?

Many thanks in advance,
Christoph


===== horde.shtml =====

<!--#include virtual="horde.php" -->

===== horde.php =====

<?php
// Define path to Horde.
define('HORDE_BASE', '/tmp/horde');

// Load the Horde Framework core, and set up inclusion paths.
require_once HORDE_BASE . '/lib/core.php';

// Create the Registry object.
$registry = &Registry::singleton();

$calendars = $registry->call('calendar/listCalendars');
print_r($calendars);
?>

===== call.php =====

<?php

function my_println($text) {
	print"$text\n";
}

call_user_func_array("my_println", array("Hello World"));

?>

-- 
Christoph Freundl    http://www10.informatik.uni-erlangen.de/~chfreund/
Lehrstuhl für Systemsimulation (Inf. 10), Cauerstr. 6, D-91058 Erlangen
People who like this sort of thing will find this is the sort of thing
                          they like. - Nixon


More information about the horde mailing list