Skip to content

Commit

Permalink
Fix #1180 - PHP5.6 cannot catch all errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Jan 22, 2017
1 parent 5717665 commit 444a65e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/I18N.php
Expand Up @@ -403,9 +403,12 @@ public static function init($code = null) {

// Create a collator
try {
self::$collator = new Collator(self::$locale->code());
// Ignore upper/lower case differences
self::$collator->setStrength(Collator::SECONDARY);
// PHP 5.6 cannot catch errors, so test first
if (class_exists('Collator')) {
self::$collator = new Collator(self::$locale->code());
// Ignore upper/lower case differences
self::$collator->setStrength(Collator::SECONDARY);
}
} catch (Exception $ex) {
// PHP-INTL is not installed? We'll use a fallback later.
}
Expand Down

0 comments on commit 444a65e

Please sign in to comment.