15 'settings' => [
'is_array',
'array' ],
16 'settings.rights' => [
'is_array',
'array' ,
'is_string',
'string' ],
17 'settings.default' => [
'is_bool',
'boolean' ],
18 'settings.hidden' => [
'is_bool',
'boolean' ],
19 'settings.skins' => [ [
__CLASS__,
'isArrayOrTrue' ],
'array or true',
'is_string',
'string' ],
20 'settings.category' => [
'is_string',
'string' ],
21 'module' => [
'is_array',
'array' ],
22 'module.scripts' => [
'is_array',
'array',
'is_string',
'string' ],
23 'module.styles' => [
'is_array',
'array',
'is_string',
'string' ],
24 'module.dependencies' => [
'is_array',
'array',
'is_string',
'string' ],
25 'module.peers' => [
'is_array',
'array',
'is_string',
'string' ],
26 'module.messages' => [
'is_array',
'array',
'is_string',
'string' ],
27 'module.type' => [
'is_string',
'string' ],
44 public function validate(
array $properties, $tolerateMissing =
false ) {
45 foreach ( self::$propertyValidation as
$property => $validation ) {
50 foreach ( $path as $p ) {
52 if ( $tolerateMissing ) {
56 return Status::newFatal(
'gadgets-validate-notset',
$property );
63 $func = $validation[0];
65 return Status::newFatal(
66 'gadgets-validate-wrongtype',
75 $func = $validation[2];
76 foreach ( $val as $i => $v ) {
78 return Status::newFatal(
79 'gadgets-validate-wrongtype',
89 return Status::newGood();
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Class responsible for validating Gadget definition contents.
static isArrayOrTrue( $value)
validate(array $properties, $tolerateMissing=false)
Check the validity of the given properties array.
static $propertyValidation
Validation metadata.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))