diff --git a/demos/php/get-events.php b/demos/php/get-events.php index 2902278..5b7b388 100644 --- a/demos/php/get-events.php +++ b/demos/php/get-events.php @@ -6,11 +6,11 @@ // // An optional "timezone" GET parameter will force all ISO8601 date stings to a given timezone. // -// Requires PHP 5.3.0 or higher. +// Requires PHP 5.2.0 or higher. //-------------------------------------------------------------------------------------------------- // Require our Event class and datetime utilities -require __DIR__ . '/utils.php'; +require dirname(__FILE__) . '/utils.php'; // Short-circuit if the client did not give us a date range. if (!isset($_GET['start']) || !isset($_GET['end'])) { @@ -30,7 +30,7 @@ if (isset($_GET['timezone'])) { } // Read and parse our events JSON file into an array of event data arrays. -$json = file_get_contents(__DIR__ . '/../json/events.json'); +$json = file_get_contents(dirname(__FILE__) . '/../json/events.json'); $input_arrays = json_decode($json, true); // Accumulate an output array of event data arrays. diff --git a/demos/php/get-timezones.php b/demos/php/get-timezones.php index afa0bfb..241e1bd 100644 --- a/demos/php/get-timezones.php +++ b/demos/php/get-timezones.php @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------------------------------- // This script outputs a JSON array of all timezones (like "America/Chicago") that PHP supports. // -// Requires PHP 5.3.0 or higher. +// Requires PHP 5.2.0 or higher. //-------------------------------------------------------------------------------------------------- echo json_encode(DateTimeZone::listIdentifiers()); \ No newline at end of file diff --git a/demos/php/utils.php b/demos/php/utils.php index fbd6cdb..a42c7d7 100644 --- a/demos/php/utils.php +++ b/demos/php/utils.php @@ -3,7 +3,7 @@ //-------------------------------------------------------------------------------------------------- // Utilities for our event-fetching scripts. // -// Requires PHP 5.3.0 or higher. +// Requires PHP 5.2.0 or higher. //-------------------------------------------------------------------------------------------------- // PHP will fatal error if we attempt to use the DateTime class without this being set. @@ -111,7 +111,7 @@ class Event { function parseDateTime($string, $timezone=null) { $date = new DateTime( $string, - $timezone ?: new DateTimeZone('UTC') + $timezone ? $timezone : new DateTimeZone('UTC') // Used only when the string is ambiguous. // Ignored if string has a timezone offset in it. );