From fda725bb4ae99a441f8786dbf4ac3aa425739543 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 19 Mar 2010 13:41:32 -0600 Subject: [PATCH] These scripts belong in horde, not the packages --- framework/Memcache/package.xml | 17 ++------------ framework/Scheduler/package.xml | 13 ++--------- framework/SessionHandler/package.xml | 17 ++++---------- .../bin/active_sessions | 16 +++++++------ .../Scheduler/horde-crond.php => horde/bin/crond | 27 +++++++++++++++------- .../Memcache/stats.php => horde/bin/memcache_stats | 8 ++----- 6 files changed, 38 insertions(+), 60 deletions(-) rename framework/SessionHandler/scripts/Horde/SessionHandler/horde-active-sessions.php => horde/bin/active_sessions (77%) rename framework/Scheduler/scripts/Horde/Scheduler/horde-crond.php => horde/bin/crond (50%) rename framework/Memcache/scripts/Horde/Memcache/stats.php => horde/bin/memcache_stats (95%) diff --git a/framework/Memcache/package.xml b/framework/Memcache/package.xml index 87433be1d..9cac16514 100644 --- a/framework/Memcache/package.xml +++ b/framework/Memcache/package.xml @@ -25,18 +25,10 @@ http://pear.php.net/dtd/package-2.0.xsd"> beta LGPL - * Initial Horde 4 package. + * Remove Horde_Core dependency. + * Initial Horde 4 package. - - - - - - - - - @@ -53,10 +45,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> 1.5.0 - Core - pear.horde.org - - Exception pear.horde.org @@ -68,7 +56,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> - diff --git a/framework/Scheduler/package.xml b/framework/Scheduler/package.xml index 0f7dad1ac..3a8e82085 100644 --- a/framework/Scheduler/package.xml +++ b/framework/Scheduler/package.xml @@ -24,19 +24,11 @@ http://pear.php.net/dtd/package-2.0.xsd"> beta LGPL - * Initial Horde 4 package. + * Removed Horde-specific command line script. + * Initial Horde 4 package. - - - - - - - - - @@ -74,7 +66,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> - diff --git a/framework/SessionHandler/package.xml b/framework/SessionHandler/package.xml index c180a12f9..55382562a 100644 --- a/framework/SessionHandler/package.xml +++ b/framework/SessionHandler/package.xml @@ -37,19 +37,11 @@ http://pear.php.net/dtd/package-2.0.xsd"> beta LGPL - * Initial Horde 4 package. + * Removed Horde-specific session counting script. + * Initial Horde 4 package. - - - - - - - - - @@ -77,11 +69,11 @@ http://pear.php.net/dtd/package-2.0.xsd"> - Horde_Memcache + Memcache pear.horde.org - Horde_SQL + SQL pear.horde.org @@ -95,7 +87,6 @@ http://pear.php.net/dtd/package-2.0.xsd"> - diff --git a/framework/SessionHandler/scripts/Horde/SessionHandler/horde-active-sessions.php b/horde/bin/active_sessions similarity index 77% rename from framework/SessionHandler/scripts/Horde/SessionHandler/horde-active-sessions.php rename to horde/bin/active_sessions index a8ff63a8f..a536192f9 100755 --- a/framework/SessionHandler/scripts/Horde/SessionHandler/horde-active-sessions.php +++ b/horde/bin/active_sessions @@ -1,4 +1,4 @@ -#!@php_bin@ +#!/usr/bin/env php */ -// Find the base file path of Horde. -$horde_base = '/path/to/horde'; - -require_once $horde_base . '/lib/Application.php'; +require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true)); /* Check for sessionhandler object. */ $registry->setupSessionHandler(); if (!$registry->sessionHandler) { - throw new Horde_Exception('Horde is unable to load the session handler'); + throw new Horde_Exception('Horde is unable to load the session handler.'); } $type = !empty($conf['sessionhandler']['type']) diff --git a/framework/Scheduler/scripts/Horde/Scheduler/horde-crond.php b/horde/bin/crond similarity index 50% rename from framework/Scheduler/scripts/Horde/Scheduler/horde-crond.php rename to horde/bin/crond index e778799f2..6fe68f2b9 100755 --- a/framework/Scheduler/scripts/Horde/Scheduler/horde-crond.php +++ b/horde/bin/crond @@ -1,25 +1,36 @@ -#!@php_bin@ +#!/usr/bin/env php '0,5,10,15,20 * * * *' +); + +// End Configuration -require_once $horde_base . '/lib/Application.php'; +require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true)); // Get an instance of the cron scheduler. $daemon = Horde_Scheduler::factory('Cron'); -// Now add some cron jobs to do, or add parsing to read a config file. -// $daemon->addTask('ls', '0,5,10,15,20,30,40 * * * *'); +// Add cron tasks. +foreach ($cron_tasks as $key => $val) { + $daemon->addTask($key, $val); +} // Start the daemon going. $daemon->run(); diff --git a/framework/Memcache/scripts/Horde/Memcache/stats.php b/horde/bin/memcache_stats similarity index 95% rename from framework/Memcache/scripts/Horde/Memcache/stats.php rename to horde/bin/memcache_stats index 81887d93e..bb8266bbc 100755 --- a/framework/Memcache/scripts/Horde/Memcache/stats.php +++ b/horde/bin/memcache_stats @@ -1,4 +1,4 @@ -#!@php_bin@ +#!/usr/bin/env php - * @package Horde_Memcache */ -// The base file path of horde. -$horde_base = '/path/to/horde'; - -require_once $horde_base . '/lib/Application.php'; +require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true)); /* Make sure there's no compression. */ -- 2.11.0