System Locale and Dates

For localisation and dates, Scorpio has several classes to help make it easier.

systemLocale is a detection and transport agent for the current request locale. It is based on the Zend Framework Zend_Locale but is modified to work with Scorpio. It is created in the main system::init step as well as being used in the MVC system and translation as a base for the current territory / language.

systemLocale can work within both a web and CLI context.

For dates and timezones, Scorpio has objects that extend the built-in PHP5 DateTime and DateTimeZone objects. These extensions add method chaining and a cleaner interface so that you can create a DateTime object without needing a timezone object - you can just use a valid timezone instead. Additional methods are included for cloning and fetching some common date properties.

Further date-related classes include a calendar and event that can be used for creating a calendar with events on particular days. This is in use on this site for the display on the right hand side of articles.

<  1  >