Ticket #626 (new defect)

Opened 3 months ago

Last modified 2 months ago

Class name conflict with a PECL extension: Locale

Reported by: arnaud Owned by:
Priority: major Milestone: Undetermined
Component: Habari Core Software Version: SVN
Keywords: Cc: chris@…

Description

If the "Internationalization Functions" PECL extension http://pecl.php.net/package/intl is installed there is class name conflict on the Locale class.

intl defines a Locale class.

Change History

Changed 3 months ago by arnaud

  • component changed from -none- to Habari Core Software

Changed 3 months ago by chrismeller

We'll need to rename the class and update all references to it. The easiest thing would be to take a PEAR-ish standard of prefixing the class with the package name: Habari_Locale. Personally, I would prefer to change it to something like 'il8n'.

Changed 3 months ago by chrismeller

  • cc chris@… added

Changed 2 months ago by sean

Changing it to something like 'i18n' only works until PHP defines a i18n class. The real fix will be in 5.3 (namespaces) but we can't expect all users to immediately switch (unfortunately), so the prefix is the proper way to do it. All classes should have prefixes, IMO. Even "HI_Locale" would be better.

See: http://php.net/manual/en/userlandnaming.php

This potentially breaks all plugins, though, and anything else that uses the API.

Changed 2 months ago by MattRead

I think the only thing that refrences Locale in the _t,_e,_n functions. and the index.php that sets locale. So this change would be easy. Prefixing every class would be a big pain.

Note: See TracTickets for help on using tickets.