MediaWiki
REL1_19
|
00001 <?php 00011 class MediaWikiProvide { 00012 00013 /* provide an array of numbers from 1 up to @param $num */ 00014 private static function createProviderUpTo( $num ) { 00015 $ret = array(); 00016 for( $i=1; $i<=$num;$i++ ) { 00017 $ret[] = array( $i ); 00018 } 00019 return $ret; 00020 } 00021 00022 /* array of months numbers (as an integer) */ 00023 public static function Months() { 00024 return self::createProviderUpTo( 12 ); 00025 } 00026 00027 /* array of days numbers (as an integer) */ 00028 public static function Days() { 00029 return self::createProviderUpTo( 31 ); 00030 } 00031 00032 public static function DaysMonths() { 00033 $ret = array(); 00034 00035 $months = self::Months(); 00036 $days = self::Days(); 00037 foreach( $months as $month) { 00038 foreach( $days as $day ) { 00039 $ret[] = array( $day[0], $month[0] ); 00040 } 00041 } 00042 return $ret; 00043 } 00044 }