Page 1 of 1

core php functions missing?

Posted: Thu Aug 09, 2012 5:52 pm
by pvg
Hi,

I have some simple code that works fine on a DreamHost server, but not on a Sonic.net server.

The reported error is
Call to undefined function gregoriantojd()
According to this site:
http://php.net/manual/en/function.gregoriantojd.php
the function should be built in as of PHP v4.

Here is the code running on website hosted on a DreamHost server:
http://chessclubforkids.com/calendar-jo ... hsubmit=Go!

Same code running on Sonic.net server:
http://dream-create-communicate.com/cal ... hsubmit=Go!

Thoughts?
I don't want to leave Sonic!!!!
But I am a programmer and must write code from time to time! : )

Thanks in advance!

Re: core php functions missing?

Posted: Fri Aug 10, 2012 8:54 am
by rodrigo
gregoriantojd() is not a core php function, it's part of a calendar functions extension. The breadcrumb over on the left shows the hierarchy of the section you're in:

PHP -> Function Reference -> Date and Time Related Extensions -> Calendar -> Calendar Functions

http://www.php.net/manual/en/intro.calendar.php

We don't have php compiled with the calendar extension, so you may need to write your own implementation of that function or find another workaround. The equations for conversion (both ways) don't seem too rough:

http://en.wikipedia.org/wiki/Julian_day ... Day_Number

Re: core php functions missing?

Posted: Fri Aug 10, 2012 3:53 pm
by williamt
I will add this with the next php update. This should happen early next week for php 5.3.15

Re: core php functions missing?

Posted: Mon Aug 13, 2012 11:08 am
by williamt
PHP has been upgraded and calendar support has been enabled.
Please note that you must be using php 5.3 for this to work.

Please refer to our wiki to enable php 5.3 if you don't have it enabled.
https://wiki.sonic.net/wiki/Php5

Thanks,
William