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

Gonçalo Queirós goncalo.queiros at portugalmail.net
Wed May 25 15:46:08 UTC 2011



On 05/25/2011 02:59 PM, Jan Schneider wrote:
>
> Zitat von Gonçalo Queirós <goncalo.queiros at portugalmail.net>:
>
>>> 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.
>>>
>>
>> If i set the SERVER_NAME environment variable, then the scripts from CLI
>> wouldn't run because they would fail on Horde_Cli::runningFromCLI(),
>> that's why i used a command line argument.
>
> Ah right, environment variables are imported into $_SERVER when
> running from CLI. I thought they would be imported into $_ENV.
> Well, it doesn't have to be exactly that variable name, I suggested it
> because it matches what we are looking at for vhost files. Maybe
> CLI_VHOST, CLI_SERVER, or CLI_SERVER_NAME?
>
> Jan.
>

I think using environment variables is even simpler. We only need to
check if the variable is created when you are including the vhosts
confs. (attached patch)

Then to create environment variable:
export CLI_SERVER_NAME={VALUE}

and to remove:
unset CLI_SERVER_NAME

This way, it could be used by every CLI script. I think this should be
documented somewhere also ;)

-- 
Gonçalo Queirós
Eng. Software
*m.* 913918777

*Portugalmail* | plataformas de inovação
*w.* http://www.portugalmail.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmp.patch
Type: text/x-patch
Size: 859 bytes
Desc: not available
URL: <http://lists.horde.org/archives/dev/attachments/20110525/859c46d2/attachment.bin>


More information about the dev mailing list