Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Installation Error: Cannot redeclare class Datetime


Go to End


6 Posts   5097 Views

Avatar
gakenny

Community Member, 153 Posts

16 January 2007 at 2:06pm

Hello,

I have commented out the line of code to check the memory size as my host has stated that the memory size is 32M (although no size is reported).

I now have another error in the installation:
Fatal error: Cannot redeclare class Datetime
in /home/xxxxxxxx/public_html/silverstripe/sapphire/core/model/fieldtypes/Datetime.php on line 27

Has anyone else encountered this error?

Cheers,

Gary

Avatar
gakenny

Community Member, 153 Posts

16 January 2007 at 11:28pm

Hello,

It seems that the answer to this issue is located here:
http://www.php.net/UPDATE_5_2.txt

'With the advent of PHP 5.2, there are object representations of the date and
timezone, named DateTime and DateTimeZone respectively. You can see the methods and constants available to the new classes by running'

This class may need to be renamed.

Cheers,

Gary

Avatar
Sam

Administrator, 690 Posts

17 January 2007 at 12:17am

This would be why people complain about PHP's lack of namespace support ;-)

I'll look at renaming this class; in the meantime are you able to use PHP 5.1?

Avatar
gakenny

Community Member, 153 Posts

17 January 2007 at 8:59am

Hi Sam,

I just had my host install PHP5 and they installed the latest release. They'll slap me if I ask them to revert to the earlier version.

I'll have to wait for the update - I can manually change the affected files myself if I knew what they were.

Cheers,

Gary

Avatar
gakenny

Community Member, 153 Posts

18 January 2007 at 10:02pm

My host has rolled back to PHP 5.1.2 and set the memory limit in Apache and the script has now successfully installed.

Now to some playing...

Avatar
Matt

Community Member, 86 Posts

1 February 2007 at 8:04pm

We've renamed this class to SSDatetime in the latest release, due out shortly. The old Datetime class still exists, but is only defined if PHP doesn't already define it. That way, legacy code written for PHP 5.1 will still work if it used Datetime (however, it won't if the server is upgraded to 5.2 - you'll have to change to using SSDatetime for it to work then).