MediaWiki
REL1_19
|
This contains some static methods for validating XMP properties. More...
Static Public Member Functions | |
static | validateBoolean ($info, &$val, $standalone) |
function to validate boolean properties ( True or False ) | |
static | validateClosed ($info, &$val, $standalone) |
function to validate properties with a fixed number of allowed choices. | |
static | validateDate ($info, &$val, $standalone) |
function to validate date properties, and convert to (partial) Exif format. | |
static | validateFlash ($info, &$val, $standalone) |
function to validate and modify flash structure | |
static | validateGPS ($info, &$val, $standalone) |
function to validate, and more importantly translate the XMP DMS form of gps coords to the decimal form we use. | |
static | validateInteger ($info, &$val, $standalone) |
function to validate integers | |
static | validateLangCode ($info, &$val, $standalone) |
function to validate LangCode properties ( en-GB, etc ) | |
static | validateRating ($info, &$val, $standalone) |
function to validate rating properties -1, 0-5 | |
static | validateRational ($info, &$val, $standalone) |
function to validate rational properties ( 12/10 ) |
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.
Definition at line 21 of file XMPValidate.php.
static XMPValidate::validateBoolean | ( | $ | info, |
&$ | val, | ||
$ | standalone | ||
) | [static] |
function to validate boolean properties ( True or False )
$info | Array information about current property |
&$val | Mixed current value to validate |
$standalone | Boolean if this is a simple property or array |
Definition at line 29 of file XMPValidate.php.
References wfDebugLog().
static XMPValidate::validateClosed | ( | $ | info, |
&$ | val, | ||
$ | standalone | ||
) | [static] |
function to validate properties with a fixed number of allowed choices.
(closed choice)
$info | Array information about current property |
&$val | Mixed current value to validate |
$standalone | Boolean if this is a simple property or array |
Definition at line 126 of file XMPValidate.php.
References wfDebugLog().
static XMPValidate::validateDate | ( | $ | info, |
&$ | val, | ||
$ | standalone | ||
) | [static] |
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
$info | Array information about current property |
&$val | Mixed current value to validate. Converts to TS_EXIF as a side-effect. in cases where there's only a partial date, it will give things like 2011:04. |
$standalone | Boolean if this is a simple property or array |
Definition at line 220 of file XMPValidate.php.
References $res, wfDebugLog(), and wfTimestamp().
Referenced by XMPValidateTest\testValidateDate().
static XMPValidate::validateFlash | ( | $ | info, |
&$ | val, | ||
$ | standalone | ||
) | [static] |
function to validate and modify flash structure
$info | Array information about current property |
&$val | Mixed current value to validate |
$standalone | Boolean if this is a simple property or array |
Definition at line 156 of file XMPValidate.php.
References wfDebugLog().
static XMPValidate::validateGPS | ( | $ | info, |
&$ | val, | ||
$ | standalone | ||
) | [static] |
function to validate, and more importantly translate the XMP DMS form of gps coords to the decimal form we use.
$info | Array unused (info about prop) |
&$val | String GPS string in either DDD,MM,SSk or or DDD,MM.mmk form |
$standalone | Boolean if its a simple prop (should always be true) |
Definition at line 317 of file XMPValidate.php.
References wfDebugLog().
static XMPValidate::validateInteger | ( | $ | info, |
&$ | val, | ||
$ | standalone | ||
) | [static] |
function to validate integers
$info | Array information about current property |
&$val | Mixed current value to validate |
$standalone | Boolean if this is a simple property or array |
Definition at line 106 of file XMPValidate.php.
References wfDebugLog().
static XMPValidate::validateLangCode | ( | $ | info, |
&$ | val, | ||
$ | standalone | ||
) | [static] |
function to validate LangCode properties ( en-GB, etc )
This is just a naive check to make sure it somewhat looks like a lang code.
$info | Array information about current property |
&$val | Mixed current value to validate |
$standalone | Boolean if this is a simple property or array |
Definition at line 190 of file XMPValidate.php.
References wfDebugLog().
static XMPValidate::validateRating | ( | $ | info, |
&$ | val, | ||
$ | standalone | ||
) | [static] |
function to validate rating properties -1, 0-5
if its outside of range put it into range.
$info | Array information about current property |
&$val | Mixed current value to validate |
$standalone | Boolean if this is a simple property or array |
Definition at line 70 of file XMPValidate.php.
References wfDebugLog().
static XMPValidate::validateRational | ( | $ | info, |
&$ | val, | ||
$ | standalone | ||
) | [static] |
function to validate rational properties ( 12/10 )
$info | Array information about current property |
&$val | Mixed current value to validate |
$standalone | Boolean if this is a simple property or array |
Definition at line 48 of file XMPValidate.php.
References wfDebugLog().