MediaWiki REL1_33
|
Public Member Functions | |
__construct ( $source) | |
Creates an SVGReader drawing from the source provided. | |
getMetadata () | |
Static Public Member Functions | |
static | scaleSVGUnit ( $length, $viewportSize=512) |
Return a rounded pixel equivalent for a labeled CSS/SVG length. | |
Public Attributes | |
const | DEFAULT_HEIGHT = 512 |
const | DEFAULT_WIDTH = 512 |
const | LANG_FULL_MATCH = 2 |
const | LANG_PREFIX_MATCH = 1 |
const | NS_SVG = 'http://www.w3.org/2000/svg' |
Protected Member Functions | |
read () | |
Read the SVG. | |
Private Member Functions | |
animateFilterAndLang ( $name) | |
Filter all children, looking for animated elements. | |
debug ( $data) | |
handleSVGAttribs () | |
Parse the attributes of an SVG element. | |
readField ( $name, $metafield=null) | |
Read a textelement from an element. | |
readXml ( $metafield=null) | |
Read an XML snippet from an element. | |
Private Attributes | |
$languagePrefixes = [] | |
$languages = [] | |
bool | $mDebug = false |
array | $metadata = [] |
null XMLReader | $reader = null |
Definition at line 42 of file SVGMetadataExtractor.php.
SVGReader::__construct | ( | $source | ) |
Creates an SVGReader drawing from the source provided.
string | $source | URI from which to read |
MWException|Exception |
Definition at line 65 of file SVGMetadataExtractor.php.
References $e, $source, $wgSVGMetadataCutoff, and(), debug(), DEFAULT_HEIGHT, DEFAULT_WIDTH, and read().
|
private |
Filter all children, looking for animated elements.
Also get a list of languages that can be targeted.
string | $name | Name of the element that we are reading from |
Definition at line 240 of file SVGMetadataExtractor.php.
References and(), debug(), LANG_FULL_MATCH, and LANG_PREFIX_MATCH.
Referenced by read().
|
private |
Definition at line 303 of file SVGMetadataExtractor.php.
References wfDebug().
Referenced by __construct(), animateFilterAndLang(), read(), readField(), and readXml().
SVGReader::getMetadata | ( | ) |
Definition at line 126 of file SVGMetadataExtractor.php.
References $metadata.
|
private |
Parse the attributes of an SVG element.
The parser has to be in the start element of "<svg>"
Definition at line 314 of file SVGMetadataExtractor.php.
References and(), DEFAULT_HEIGHT, DEFAULT_WIDTH, and scaleSVGUnit().
Referenced by read().
|
protected |
Read the SVG.
MWException |
Definition at line 135 of file SVGMetadataExtractor.php.
References $languagePrefixes, $type, and(), animateFilterAndLang(), debug(), handleSVGAttribs(), NS_SVG, readField(), and readXml().
Referenced by __construct().
|
private |
Read a textelement from an element.
string | $name | Name of the element that we are reading from |
string | $metafield | Field that we will fill with the result |
Definition at line 198 of file SVGMetadataExtractor.php.
References and(), and debug().
Referenced by read().
|
private |
Read an XML snippet from an element.
string | $metafield | Field that we will fill with the result |
MWException |
Definition at line 223 of file SVGMetadataExtractor.php.
References and(), and debug().
Referenced by read().
|
static |
Return a rounded pixel equivalent for a labeled CSS/SVG length.
https://www.w3.org/TR/SVG11/coords.html#Units
string | $length | CSS/SVG length. |
float | int | $viewportSize | Optional scale for percentage units... |
Definition at line 365 of file SVGMetadataExtractor.php.
References $matches, and and().
Referenced by handleSVGAttribs(), and SVGMetadataExtractorTest\testScaleSVGUnit().
|
private |
Definition at line 58 of file SVGMetadataExtractor.php.
Referenced by read().
|
private |
Definition at line 57 of file SVGMetadataExtractor.php.
|
private |
Definition at line 53 of file SVGMetadataExtractor.php.
|
private |
Definition at line 56 of file SVGMetadataExtractor.php.
Referenced by getMetadata().
Definition at line 50 of file SVGMetadataExtractor.php.
const SVGReader::DEFAULT_HEIGHT = 512 |
Definition at line 44 of file SVGMetadataExtractor.php.
Referenced by __construct(), and handleSVGAttribs().
const SVGReader::DEFAULT_WIDTH = 512 |
Definition at line 43 of file SVGMetadataExtractor.php.
Referenced by __construct(), and handleSVGAttribs().
const SVGReader::LANG_FULL_MATCH = 2 |
Definition at line 47 of file SVGMetadataExtractor.php.
Referenced by animateFilterAndLang(), SvgHandler\getAvailableLanguages(), SvgHandlerTest\provideAvailableLanguages(), SVGMetadataExtractorTest\provideSvgFiles(), ParserTestRunner\setupUploads(), and SvgHandlerTest\testNormaliseParamsInternal().
const SVGReader::LANG_PREFIX_MATCH = 1 |
Definition at line 46 of file SVGMetadataExtractor.php.
Referenced by animateFilterAndLang(), SvgHandlerTest\provideAvailableLanguages(), and SVGMetadataExtractorTest\provideSvgFiles().
const SVGReader::NS_SVG = 'http://www.w3.org/2000/svg' |
Definition at line 45 of file SVGMetadataExtractor.php.
Referenced by read().