We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

Bug 1707 - PHP 4.2.x incompatibilities
PHP 4.2.x incompatibilities
Product: OJS
Classification: Unclassified
Component: General
All All
: P2 normal
Assigned To: PKP Support
Depends on:
  Show dependency treegraph
Reported: 2005-07-09 11:36 PDT by Kevin Jamieson
Modified: 2005-07-09 19:17 PDT (History)
0 users

See Also:
Version Reported In:
Also Affects:


Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Jamieson 2005-07-09 11:36:48 PDT
There are two known incompatibilities with PHP 4.2.x in the current code base:

1) file_get_contents() in lib/adodb/adodb-xmlschema.inc.php is not available on
PHP < 4.3. 

A workaround would be to add to includes/functions.inc.php:

if (!function_exists('file_get_contents')) {
	function file_get_contents($file) {
		return join('', file($file));

2) setlocale() in 
classes/i18n/Locale.inc.php cannot take more than one locale on PHP < 4.3

A work-around would be to change:

setlocale(LC_ALL, $locale . '.' . LOCALE_ENCODING, $locale);


setlocale(LC_ALL, $locale . '.' . LOCALE_ENCODING);

(or, if, for example, the en_US.UTF-8 character set is not available but en_US
is, change it to setlocale(LC_ALL, $locale) instead).

It would also not be unreasonable to drop "official" PHP 4.2.x support
(docs/README currently lists it as supported). It's been 2.5 years since PHP 4.3
was released, and AFAIK we have not actively tested OJS on 4.2 in quite some
time so guaranteeing compatibility is difficult.
Comment 1 Kevin Jamieson 2005-07-09 19:17:12 PDT
Fixed incompatible code.