API Rename Transliterator to SS_Transliterator to remove conflict with Intl extension

This commit is contained in:
Simon Welsh 2012-11-29 08:21:05 +13:00
parent 326036a501
commit f49f1ff5df
2 changed files with 8 additions and 4 deletions

View File

@ -1517,7 +1517,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
*/
function generateURLSegment($title){
$t = (function_exists('mb_strtolower')) ? mb_strtolower($title) : strtolower($title);
$t = Object::create('Transliterator')->toASCII($t);
$t = Object::create('SS_Transliterator')->toASCII($t);
$t = str_replace('&','-and-',$t);
$t = str_replace('&','-and-',$t);
$t = ereg_replace('[^A-Za-z0-9]+','-',$t);

View File

@ -6,14 +6,14 @@
* Usage:
*
* <code>
* $tr = new Transliterator();
* $tr = new SS_Transliterator();
* $ascii = $tr->toASCII($unicode);
* </code>
*
* @package sapphire
* @subpackage model
*/
class Transliterator {
class SS_Transliterator {
/**
* Allow the use of iconv() to perform transliteration. Set to false to disable.
* Even if this variable is true, iconv() won't be used if it's not installed.
@ -58,4 +58,8 @@ class Transliterator {
protected function useIconv($source) {
return iconv("utf-8", "us-ascii//IGNORE//TRANSLIT", $source);
}
}
}
if(!class_exists('Transliterator')) {
class Transliterator extends SS_Transliterator {}
}