3 function read_whole_file($name) {
4 $fd = fopen($name, 'r');
6 die("Failed to read file: '$name'");
8 $file_data = fread($fd, filesize($name));
13 function unix_newlines($str) {
14 $str = str_replace("\r\n", "\n", $str);
15 return str_replace("\r", "\n", $str);
18 # return current year (all 4 digits)
19 function this_year() {
20 return strftime('%Y');
23 # return the number of the current month (1..12)
24 function this_month() {
25 return strftime('%m');
29 # php4 is broken, in that you cannot set a default value for a parameter that
30 # is passed by reference. So, this is set up to use the following screwy
33 # function foo($bar = 0) {
43 class stupid_reference {
45 function stupid_reference(&$ref) {
50 return new stupid_reference($foo);