[dev] Send event reminders and daily agendas for different domains

Jan Schneider jan at horde.org
Wed May 25 10:59:39 UTC 2011


Zitat von Gonçalo Queirós <goncalo.queiros at portugalmail.net>:

> On 05/17/2011 09:01 AM, Jan Schneider wrote:
>>
>> Zitat von Gonçalo Queirós <goncalo.queiros at portugalmail.net>:
>>
>>> On 05/13/2011 09:28 PM, Jan Schneider wrote:
>>>>
>>>> Zitat von Gonçalo Queirós <goncalo.queiros at portugalmail.net>:
>>>>
>>>>> Is there any way to send event reminders and daily agendas if we have
>>>>> multiple vhosts?
>>>>> Looking at the code that doesn't seem possible, but i might be missing
>>>>> something.
>>>>
>>>> Why should it not be possible?
>>>>
>>>> Jan.
>>>>
>>>
>>> Because Kronolith needs info about the database and those infos in my
>>> case are stored in every domain conf file.
>>>
>>> The main conf.php has database = '' and the daily agenda throws an
>>> error because it doens't have a DB to connect to. I looked at the
>>> code and i don't think kronolith-agenda knows that he needs to check
>>> all conf domains specific values to get all databases that he needs
>>> to look into.
>>>
>>> I also think that Kronolith will only load its generic conf and not
>>> every domain specific conf, so the reminder email will always have
>>> the same "From" for all domains
>>
>> Good point. We probably need to allow reading the vhost from an
>> environment variable, additionally to $_SERVER['SERVER_NAME']. For a
>> quick fix, you can create a small wrapper PHP script that sets this
>> variable and then loads the actual CLI script.
>>
>> Jan.
>>
>
> Attached a patch. Was something like this that you were thinking?

Yes, this is the right direction. I would strip cli_ from the option  
name though, because it could potentially be users for different  
things than CLI scripts. And I would rather use an environment  
variable (SERVER_NAME) than a command line argument for the actual  
script, because you can run several several scripts under the same  
environment, or one script under several environments, without  
changing the script calls. Finally, this should of course be used by  
all CLI scripts.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/



More information about the dev mailing list