Monday, 15 July 2013

php - Cron job and top level domain -



php - Cron job and top level domain -

the site i'm working on, using top level domain (.nl/.be) define language , database should use. allows same website used multiple domains, having each own content, same layout.

all works well, except when gets cron jobs. domain used define database used via $_server['http_host']. cronjob, file called straight without utilize of domain (local domain hierarchy), hence cannot derive database/language should use.

is there way have cron jobs utilize same principle or stuck having send along variable define database/language should use?

you force value within environment variables:

@daily http_host=www.example.nl php /path/to/script.php

the environment variable should appear within $_server create work per normal.

php dns cron

No comments:

Post a Comment