From: Chuck Hagenbuch Date: Fri, 8 Jan 2010 15:28:52 +0000 (-0500) Subject: Start a bin/ directory for Horde for scripts that are expected to be run as part X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3616f97cdccbf6fbc83a3920de3dc5a5789027f2;p=horde.git Start a bin/ directory for Horde for scripts that are expected to be run as part of either using or maintaining Horde. --- diff --git a/horde/bin/alarms b/horde/bin/alarms new file mode 100755 index 000000000..a75115a83 --- /dev/null +++ b/horde/bin/alarms @@ -0,0 +1,35 @@ +#!/usr/bin/env php + + */ + +// Do CLI checks and environment setup first. +require_once dirname(__FILE__) . '/../lib/core.php'; + +// Make sure no one runs this from the web. +if (!Horde_Cli::runningFromCLI()) { + exit("Must be run from the command line\n"); +} + +// Load the CLI environment - make sure there's no time limit, init some +// variables, etc. +Horde_Cli::init(); + +// Include needed libraries. +new Horde_Application(array('authentication' => 'none')); + +// Authenticate as administrator. +if (!count($conf['auth']['admins'])) { + exit("You must have at least one administrator configured to run the alarms.php script.\n"); +} +Horde_Auth::setAuth($conf['auth']['admins'][0], array()); + +// Run +$horde_alarm = Horde_Alarm::factory(); +$horde_alarm->notify(null, true, false, array('notify')); diff --git a/horde/scripts/alarms.php b/horde/scripts/alarms.php deleted file mode 100755 index a75115a83..000000000 --- a/horde/scripts/alarms.php +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env php - - */ - -// Do CLI checks and environment setup first. -require_once dirname(__FILE__) . '/../lib/core.php'; - -// Make sure no one runs this from the web. -if (!Horde_Cli::runningFromCLI()) { - exit("Must be run from the command line\n"); -} - -// Load the CLI environment - make sure there's no time limit, init some -// variables, etc. -Horde_Cli::init(); - -// Include needed libraries. -new Horde_Application(array('authentication' => 'none')); - -// Authenticate as administrator. -if (!count($conf['auth']['admins'])) { - exit("You must have at least one administrator configured to run the alarms.php script.\n"); -} -Horde_Auth::setAuth($conf['auth']['admins'][0], array()); - -// Run -$horde_alarm = Horde_Alarm::factory(); -$horde_alarm->notify(null, true, false, array('notify'));