Register a new format
string $name The name of the format (e.g. ntriples):
string $label The label for the format (e.g. N-Triples):
string $uri The URI for the format:
string $mimeTypes One or more mime types for the format:
string $extensions One or more extensions (file suffix):
object The new EasyRdf_Format object
public static function register($name, $label = null, $uri = null, $mimeTypes = array(), $extensions = array()) {
if (!is_string($name) or $name == null or $name == '') {
throw new InvalidArgumentException("\$name should be a string and cannot be null or empty");
}
if (!array_key_exists($name, self::$formats)) {
self::$formats[$name] = new EasyRdf_Format($name);
}
self::$formats[$name]
->setLabel($label);
self::$formats[$name]
->setUri($uri);
self::$formats[$name]
->setMimeTypes($mimeTypes);
self::$formats[$name]
->setExtensions($extensions);
return self::$formats[$name];
}