21 final public static function getExporters($onlyForPublicUse =
false)
23 if (!isset(self::$exporters)) {
26 foreach (scandir(__DIR__) as
$f) {
27 if (preg_match(
'/^(\w+)\.php$/',
$f,
$m)) {
28 if (
$f !== basename(__FILE__)) {
35 if ($onlyForPublicUse) {
37 foreach (self::$exporters as $handle => $class) {
38 if (call_user_func(self::getExporterClassName($handle).
'::isForPublicUse') ===
true) {
58 throw new Exception(
"Invalid exporter handle: '$exporterHandle'");
61 return call_user_func(self::getExporterClassName($exporterHandle).
'::getDescription');
70 return __NAMESPACE__.
'\\'.ucfirst(strtolower($exporterHandle));
79 throw new Exception(get_called_class().
' does not implement the method '.__FUNCTION__);
92 $asciiList[] =
$language->getUSAsciiClone();
109 throw new Exception(
"Error writing data to '$filename'");
126 throw new Exception(get_called_class().
' does not implement the method '.__FUNCTION__);
An exception for terminatinating execution or to throw for unit testing.
Base class for all the exporters.
static getExporters($onlyForPublicUse=false)
Return the list of all the available exporters.
static isForPublicUse()
Is this exporter for public use?
static getExporterClassName($exporterHandle)
Returns the fully qualified class name of a exporter given its handle.
static toString($languages, $options=null)
Convert a list of Language instances to string.
static toFile($languages, $filename, $options=null)
Save the Language instances to a file.
static getDescription()
Return a short description of the exporter.
static getExporterDescription($exporterHandle)
Return the description of a specific exporter.
static toStringDo($languages)
Convert a list of Language instances to string.
Main class to convert the plural rules of a language from CLDR to gettext.