Merge pull request #977 from simonwelsh/rename-Transliterator

API Rename Transliterator to SS_Transliterator to remove conflict with Intl extension
This commit is contained in:
Ingo Schommer 2012-11-30 06:55:53 -08:00
commit 3268c0dee8
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.
@ -59,3 +59,7 @@ class Transliterator {
return iconv("utf-8", "us-ascii//IGNORE//TRANSLIT", $source);
}
}
if(!class_exists('Transliterator')) {
class Transliterator extends SS_Transliterator {}
}