File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 126126 */
127127//define('RAXSDK_CACERTPEM', __DIR__ . DIRECTORY_SEPARATOR . 'cacert.pem');
128128
129- // set the default timezone
130- date_default_timezone_set (RAXSDK_TIMEZONE );
131-
132129/* these should not be overridden */
133130define ('RAXSDK_VERSION ' , '1.5.4 ' );
134131define ('RAXSDK_USER_AGENT ' , 'php-opencloud/ ' .RAXSDK_VERSION .' (Rackspace) ' );
172169 */
173170define ('RAX_PRIVATE ' ,'11111111-1111-1111-1111-111111111111 ' );
174171
172+ /********** TIMEZONE MAGIC **********/
173+
174+ /**
175+ * This is called if there is an error getting the default timezone;
176+ * that means that the default timezone isn't set.
177+ */
178+ function __raxsdk_timezone_set ($ errno , $ errstr ) {
179+ if ($ errno ==2 )
180+ date_default_timezone_set (RAXSDK_TIMEZONE );
181+ else
182+ die (sprintf ("Unknown error %d: %s \n" , $ errno , $ errstr ));
183+ }
184+ set_error_handler ('\OpenCloud\__raxsdk_timezone_set ' );
185+ @date_default_timezone_get ();
186+ restore_error_handler ();
175187
176188/********** SOME GLOBAL FUNCTIONS **********/
177189
You can’t perform that action at this time.
0 commit comments