Project

General

Profile

Bug #904

Chamilo187a doesn't work without Internationalization library

Added by Hubert Borderiou over 9 years ago. Updated over 9 years ago.

Status:
Bug resolved
Priority:
Normal
Category:
-
Target version:
Start date:
07/04/2010
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Hi,
I haven't got the Internationalization libraty on my server, nor JSON, nor Xapian.
Internationalization and Xapian are optional, but there is an error with Internationalization :

Class 'DateTime' not found in /main/inc/lib/internationalization.lib.php on line 508

I've modified file /main/inc/lib|internationalization.lib.php
[389]function api_get_local_time
to test if function DateTime exists.

function api_get_local_time($time = null, $to_timezone=null, $from_timezone=null) {
    if (!function_exists('DateTime')) return date('Y-m-d H:i:s');
    // Determining the timezone to be converted from

Perhaps, thanks to the modification Ivan Tcholakov did (http://support.chamilo.org/issues/761), JSON may be optional to.

Hope this help.

Regards

History

#1

Updated by Ivan Tcholakov over 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Ivan Tcholakov

Chamilo does not work without Internationalization library - yes, this is true. :-)

The problem is that you are using PHP 5.1.x. Your method seems to be good, I am going to implement it. Only I will modify it a little for better performance.

#2

Updated by Ivan Tcholakov over 9 years ago

11451:93eb1c23934c Bug #904 - Adding a constant in the main API to indicate whether data/time extension (http://www.php.net/datetime) is installed or not. This is important for PHP <= 5.2.
http://code.google.com/p/chamilo/source/detail?r=93eb1c23934c338fcb0554e1615ba232dd2aedb5&repo=classic

#3

Updated by Ivan Tcholakov over 9 years ago

I've just seen that Chamilo now REQUIRES PHP 5.2 as a minimum. This is what Yannick says. Ok, I am going to finish this task, but this is the last one that I accept because PHP5 is old.

#4

Updated by Ivan Tcholakov over 9 years ago

  • Status changed from Assigned to Needs more info
  • % Done changed from 0 to 90

11454:fffaa02f8755 Bug #904 - Suppressing fatal errors in some timezone related functions when Chamilo runs on PHP < 5.2.
http://code.google.com/p/chamilo/source/detail?r=fffaa02f8755bccb3da8070d5806a90da094db8d&repo=classic

Please, Hubert, tell me how these changes work on your system.

#5

Updated by Yannick Warnier over 9 years ago

We're going to package a 1.8.7 alpha 2 tonight, so hold on for a few hours more if you don't want to test from the (volatile) sources.
This being said, I have also "upped" the requirement of PHP to PHP 5.2, because of the datetime library. I don't think this will be a major problem given that 5.2 was already available on some hosting servers 2 years ago, but still... if this is a real problem, we'll just make sure that your patch (Ivan) is alright with 5.1 and lower the requirement again before the beta.

#6

Updated by Hubert Borderiou over 9 years ago

I've replaced my main_api.lib.php and internationalization.lib.php with yours, and it works fine.
No pb for me if Chamilo 1.8.7 is > php5.2 required.
I can continue testing it with my php5.1 if you need to.

#7

Updated by Ivan Tcholakov over 9 years ago

Hubert Borderiou wrote:

I've replaced my main_api.lib.php and internationalization.lib.php with yours, and it works fine.

It works with PHP 5.1, is this true?

#8

Updated by Hubert Borderiou over 9 years ago

Yes my PHP version is 5.1.6
and it works fine.

#9

Updated by Ivan Tcholakov over 9 years ago

A message to Yannick: I think, we may "lower" the requirement from PHP 5.2.x to PHP 5.1.x. A correspondent change in the version-based blockers could be done (in the installation and the global initialization scripts).

From today's point of view PHP 5.0.x versions are not reliable and safe enough, we should not accept them at all. I suppose PHP 5.1.x is still used in some places, because there are Linux systems with paid support for which upgrading is delayed.

#10

Updated by Yannick Warnier over 9 years ago

  • Status changed from Needs more info to Bug resolved
  • % Done changed from 90 to 100

Also available in: Atom PDF