[ Index ]

PHP Cross Reference of MediaWiki-1.24.0

title

Body

[close]

/includes/media/ -> XMPValidate.php (summary)

Methods for validating XMP properties. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

File Size: 381 lines (12 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

XMPValidate:: (9 methods):
  validateBoolean()
  validateRational()
  validateRating()
  validateInteger()
  validateClosed()
  validateFlash()
  validateLangCode()
  validateDate()
  validateGPS()


Class: XMPValidate  - X-Ref

This contains some static methods for
validating XMP properties. See XMPInfo and XMPReader classes.

Each of these functions take the same parameters
* an info array which is a subset of the XMPInfo::items array
* A value (passed as reference) to validate. This can be either a
simple value or an array
* A boolean to determine if this is validating a simple or complex values

It should be noted that when an array is being validated, typically the validation
function is called once for each value, and then once at the end for the entire array.

These validation functions can also be used to modify the data. See the gps and flash one's
for example.

validateBoolean( $info, &$val, $standalone )   X-Ref
Function to validate boolean properties ( True or False )

param: array $info Information about current property
param: mixed &$val Current value to validate
param: bool $standalone If this is a simple property or array

validateRational( $info, &$val, $standalone )   X-Ref
function to validate rational properties ( 12/10 )

param: array $info Information about current property
param: mixed &$val Current value to validate
param: bool $standalone If this is a simple property or array

validateRating( $info, &$val, $standalone )   X-Ref
function to validate rating properties -1, 0-5

if its outside of range put it into range.

param: array $info Information about current property
param: mixed &$val Current value to validate
param: bool $standalone If this is a simple property or array

validateInteger( $info, &$val, $standalone )   X-Ref
function to validate integers

param: array $info Information about current property
param: mixed &$val Current value to validate
param: bool $standalone If this is a simple property or array

validateClosed( $info, &$val, $standalone )   X-Ref
function to validate properties with a fixed number of allowed
choices. (closed choice)

param: array $info Information about current property
param: mixed &$val Current value to validate
param: bool $standalone If this is a simple property or array

validateFlash( $info, &$val, $standalone )   X-Ref
function to validate and modify flash structure

param: array $info Information about current property
param: mixed &$val Current value to validate
param: bool $standalone If this is a simple property or array

validateLangCode( $info, &$val, $standalone )   X-Ref
function to validate LangCode properties ( en-GB, etc )

This is just a naive check to make sure it somewhat looks like a lang code.

param: array $info Information about current property
param: mixed &$val Current value to validate
param: bool $standalone If this is a simple property or array

validateDate( $info, &$val, $standalone )   X-Ref
function to validate date properties, and convert to (partial) Exif format.

Dates can be one of the following formats:
YYYY
YYYY-MM
YYYY-MM-DD
YYYY-MM-DDThh:mmTZD
YYYY-MM-DDThh:mm:ssTZD
YYYY-MM-DDThh:mm:ss.sTZD

param: array $info Information about current property
param: mixed &$val Current value to validate. Converts to TS_EXIF as a side-effect.
param: bool $standalone If this is a simple property or array

validateGPS( $info, &$val, $standalone )   X-Ref
No description



Generated: Fri Nov 28 14:03:12 2014 Cross-referenced by PHPXref 0.7.1