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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

cron tasks and database not defined in SS 2.4


Go to End


1130 Views

Avatar
lekoala

Community Member, 31 Posts

26 April 2013 at 7:26pm

Hi there,

I'm stuck on a problem with schedulded tasks. I have read this
http://api.silverstripe.org/2.4/class-ScheduledTask.html
and this
http://deadlytechnology.com/silverstripe/scheduled-tasks/
and everything seems to be working quite well on my local host but on the live server, the database connection is not initialized so when I call any dataobject, it fails.

I can see that SS_DATABASE_USERNAME and SS_DATABASE_PASSWORD are configured correctly from my __ss_environment.php file, but that don't seem to be enough. Is the _config.php executed when running silverstripe from the command line?
if not, how can I specify my database name and initialize my connection without duplicating my configuration that is already in _config.php

If someone has a bright idea, it would be great!