Home » Date and Time » Date » Bug #3059
Variables defined outside the Date_Span class are not available
Details
| Submitted | 2004-12-30 14:53 UTC |
|---|---|
| From | a dot schilder at gmx dot de |
| Assigned | pajoye |
| Status | Closed |
| Package | Date |
| PHP Version | 5.0.0 |
| OS | Windows 2000 |
| Roadmaps | (Not assigned) |
Comments
[2004-12-30 14:53 UTC] a dot schilder at gmx dot de
Description:
------------
We're using the __autoload function to load the date classes when needed. The __autoload functions uses an autoload class to include the required files.
Above the Date_Span class two varaibles are defined without using the $GLOBALS array - these variables are not available when the class is autoloaded (Notice: Undefined index: _DATE_SPAN_INPUT_FORMAT in [...]\Date\Span.php on line 243).
Simply use
$GLOBALS['_DATE_SPAN_FORMAT'] = '%C';
...
$GLOBALS['_DATE_SPAN_INPUT_FORMAT'] = DATE_SPAN_INPUT_FORMAT_NNSV;
(as in the other files) instead of
$_DATE_SPAN_FORMAT = '%C';
...
$_DATE_SPAN_INPUT_FORMAT = DATE_SPAN_INPUT_FORMAT_NNSV;
and all is fine;)
Bye,
Achim