<api>beta</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Initial Horde 4 package.</notes>
+ <notes>* Remove Horde_Core dependency.
+ * Initial Horde 4 package.</notes>
<contents>
<dir name="/">
- <dir name="scripts">
- <dir name="Horde">
- <dir name="Memcache">
- <file name="stats.php" role="script">
- <tasks:replace from="@php_bin@" to="php_bin" type="pear-config"/>
- </file>
- </dir> <!-- /scripts/Horde/Memcache -->
- </dir> <!-- /scripts/Horde -->
- </dir> <!-- /scripts -->
<dir name="lib">
<dir name="Horde">
<file name="Memcache.php" role="php" />
<min>1.5.0</min>
</pearinstaller>
<package>
- <name>Core</name>
- <channel>pear.horde.org</channel>
- </package>
- <package>
<name>Exception</name>
<channel>pear.horde.org</channel>
</package>
<phprelease>
<filelist>
<install name="lib/Horde/Memcache.php" as="Horde/Memcache.php" />
- <install name="scripts/Horde/Memcache/stats.php" as="horde-memcache-stats" />
</filelist>
</phprelease>
<changelog>
+++ /dev/null
-#!@php_bin@
-<?php
-/**
- * This script outputs statistics on the current memcache pool.
- *
- * Usage: stats.php [--all] [--flush] [--lookup=key] [--raw] [--summary]
- *
- * By default, shows statistics for all servers.
- *
- * Copyright 2007-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @author Michael Slusarz <slusarz@horde.org>
- * @package Horde_Memcache
- */
-
-// The base file path of horde.
-$horde_base = '/path/to/horde';
-
-require_once $horde_base . '/lib/Application.php';
-Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true));
-
-/* Make sure there's no compression. */
-@ob_end_clean();
-
-$c = new Console_Getopt();
-$argv = $c->readPHPArgv();
-array_shift($argv);
-$options = $c->getopt2($argv, '', array('all', 'flush', 'lookup=', 'raw', 'summary'));
-if (PEAR::isError($options)) {
- $cli->writeln($cli->red("ERROR: Invalid arguments."));
- exit;
-}
-
-$all = $raw = $summary = false;
-$memcache = $injector->getInstance('Horde_Memcache');
-
-foreach ($options[0] as $val) {
- switch ($val[0]) {
- case '--all':
- $all = true;
- break;
-
- case '--flush':
- if ($cli->prompt($cli->red('Are you sure you want to flush all data?'), array('y' => 'Yes', 'n' => 'No'), 'n') == 'y') {
- $memcache->flush();
- $cli->writeln($cli->green('Done.'));
- }
- exit;
-
- case '--lookup':
- $data = $memcache->get($val[1]);
- if (!empty($data)) {
- $cli->writeln(print_r($data, true));
- } else {
- $cli->writeln('[Key not found.]');
- }
- exit;
-
- case '--raw':
- $raw = true;
- break;
-
- case '--summary':
- $summary = true;
- break;
- }
-}
-
-$stats = $memcache->stats();
-
-if ($raw) {
- $cli->writeln(print_r($stats, true));
-} elseif (!$summary) {
- $all = true;
-}
-
-if ($all || $summary) {
- if ($summary) {
- $total = array();
- $total_keys = array('bytes', 'limit_maxbytes', 'curr_items', 'total_items', 'get_hits', 'get_misses', 'curr_connections', 'bytes_read', 'bytes_written');
- foreach ($total_keys as $key) {
- $total[$key] = 0;
- }
- }
-
- $i = $s_count = count($stats);
-
- foreach ($stats as $key => $val) {
- if ($summary) {
- foreach ($total_keys as $k) {
- $total[$k] += $val[$k];
- }
- }
-
- if ($all) {
- $cli->writeln($cli->green('Server: ' . $key . ' (Version: ' . $val['version'] . ' - ' . $val['threads'] . ' thread(s))'));
- _outputInfo($val, $cli);
- if (--$i || $summary) {
- $cli->writeln();
- }
- }
- }
-
- if ($summary) {
- $cli->writeln($cli->green('Memcache pool (' . $s_count . ' server(s))'));
- _outputInfo($total, $cli);
- }
-}
-
-function _outputInfo($val, $cli)
-{
- $cli->writeln($cli->indent('Size: ' . sprintf("%0.2f", $val['bytes'] / 1048576) . ' MB (Max: ' . sprintf("%0.2f", ($val['limit_maxbytes']) / 1048576) . ' MB - ' . ((!empty($val['limit_maxbytes']) ? round(($val['bytes'] / $val['limit_maxbytes']) * 100, 1) : 'N/A')) . '% used)'));
- $cli->writeln($cli->indent('Items: ' . $val['curr_items'] . ' (Total: ' . $val['total_items'] . ')'));
- $cli->writeln($cli->indent('Cache Ratio: ' . $val['get_hits'] . ' hits, ' . $val['get_misses'] . ' misses'));
- $cli->writeln($cli->indent('Connections: ' . $val['curr_connections']));
- $cli->writeln($cli->indent('Traffic: ' . sprintf("%0.2f", $val['bytes_read'] / 1048576) . ' MB in, ' . sprintf("%0.2f", $val['bytes_written'] / 1048576) . ' MB out'));
-}
<api>beta</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Initial Horde 4 package.
+ <notes>* Removed Horde-specific command line script.
+ * Initial Horde 4 package.
</notes>
<contents>
<dir name="/">
- <dir name="scripts">
- <dir name="Horde">
- <dir name="Scheduler">
- <file name="horde-crond.php" role="script">
- <tasks:replace from="@php_bin@" to="php_bin" type="pear-config"/>
- </file>
- </dir> <!-- /scripts/Horde/Scheduler -->
- </dir> <!-- /scripts/Horde -->
- </dir> <!-- /scripts -->
<dir name="lib">
<dir name="Horde">
<dir name="Scheduler">
</dependencies>
<phprelease>
<filelist>
- <install name="scripts/Horde/Scheduler/horde-crond.php" as="horde-crond" />
<install name="lib/Horde/Scheduler/Cron/Date.php" as="Horde/Scheduler/Cron/Date.php" />
<install name="lib/Horde/Scheduler/Cron.php" as="Horde/Scheduler/Cron.php" />
<install name="lib/Horde/Scheduler.php" as="Horde/Scheduler.php" />
+++ /dev/null
-#!@php_bin@
-<?php
-/**
- * Copyright 2003-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @package Horde_Scheduler
- */
-
-// The base file path of horde.
-$horde_base = '/path/to/horde';
-
-require_once $horde_base . '/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 * * * *');
-
-// Start the daemon going.
-$daemon->run();
<api>beta</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Initial Horde 4 package.
+ <notes>* Removed Horde-specific session counting script.
+ * Initial Horde 4 package.
</notes>
<contents>
<dir name="/">
- <dir name="scripts">
- <dir name="Horde">
- <dir name="SessionHandler">
- <file name="horde-active-sessions.php" role="script">
- <tasks:replace from="@php_bin@" to="php_bin" type="pear-config"/>
- </file>
- </dir> <!-- /scripts/Horde/SessionHandler -->
- </dir> <!-- /scripts/Horde -->
- </dir> <!-- /scripts -->
<dir name="lib">
<dir name="Horde">
<dir name="SessionHandler">
</required>
<optional>
<package>
- <name>Horde_Memcache</name>
+ <name>Memcache</name>
<channel>pear.horde.org</channel>
</package>
<package>
- <name>Horde_SQL</name>
+ <name>SQL</name>
<channel>pear.horde.org</channel>
</package>
</optional>
<install name="lib/Horde/SessionHandler/Oci8.php" as="Horde/SessionHandler/Pgsql.php" />
<install name="lib/Horde/SessionHandler/Sql.php" as="Horde/SessionHandler/Sql.php" />
<install name="lib/Horde/SessionHandler.php" as="Horde/SessionHandler.php" />
- <install name="scripts/Horde/SessionHandler/horde-active-sessions.php" as="scripts/horde-active-sessions.php" />
</filelist>
</phprelease>
<changelog>
+++ /dev/null
-#!@php_bin@
-<?php
-/**
- * This script counts the number of active authenticated user sessions.
- *
- * Command line options:
- * '-l' List the username of active authenticated users
- * '-ll' List the username and login time of active authenticated users
- *
- * @package Horde_SessionHandler
- */
-
-// Find the base file path of Horde.
-$horde_base = '/path/to/horde';
-
-require_once $horde_base . '/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');
-}
-
-$type = !empty($conf['sessionhandler']['type'])
- ? $conf['sessionhandler']['type']
- : 'builtin';
-
-if ($type == 'external') {
- throw new Horde_Exception('Session counting is not supported in the \'external\' SessionHandler.');
-}
-
-$sessions = $registry->sessionHandler->getSessionsInfo();
-
-if (($argc < 2) || (($argv[1] != '-l') && ($argv[1] != '-ll'))) {
- $cli->writeln(count($sessions));
-} else {
- foreach ($sessions as $data) {
- if ($argv[1] == '-ll') {
- $cli->writeln($data['userid'] . ' [' . date('r', $data['timestamp']) . ']');
- } else {
- $cli->writeln($data['userid']);
- }
- }
- $cli->writeln($cli->green('Total Sessions: ' . count($sessions)));
-}
--- /dev/null
+#!/usr/bin/env php
+<?php
+/**
+ * This script counts the number of active authenticated user sessions.
+ *
+ * Command line options:
+ * '-l' List the username of active authenticated users
+ * '-ll' List the username and login time of active authenticated users
+ *
+ * Copyright 2007-2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author Michael Slusarz <slusarz@horde.org>
+ */
+
+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.');
+}
+
+$type = !empty($conf['sessionhandler']['type'])
+ ? $conf['sessionhandler']['type']
+ : 'builtin';
+
+if ($type == 'external') {
+ throw new Horde_Exception('Session counting is not supported in the \'external\' SessionHandler.');
+}
+
+$sessions = $registry->sessionHandler->getSessionsInfo();
+
+if (($argc < 2) || (($argv[1] != '-l') && ($argv[1] != '-ll'))) {
+ $cli->writeln(count($sessions));
+} else {
+ foreach ($sessions as $data) {
+ if ($argv[1] == '-ll') {
+ $cli->writeln($data['userid'] . ' [' . date('r', $data['timestamp']) . ']');
+ } else {
+ $cli->writeln($data['userid']);
+ }
+ }
+ $cli->writeln($cli->green('Total Sessions: ' . count($sessions)));
+}
--- /dev/null
+#!/usr/bin/env php
+<?php
+/**
+ * Horde cron daemon. Cron
+ *
+ * Copyright 2003-2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ */
+
+// Configuration
+
+// Tasks configuration.
+// KEY: scriptname
+// VALUE: crontab definition
+$cron_tasks = array(
+ // Basic example: list files at xx:00, xx:05, xx:10, and xx:20
+ // '/bin/ls' => '0,5,10,15,20 * * * *'
+);
+
+// End Configuration
+
+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');
+
+// Add cron tasks.
+foreach ($cron_tasks as $key => $val) {
+ $daemon->addTask($key, $val);
+}
+
+// Start the daemon going.
+$daemon->run();
--- /dev/null
+#!/usr/bin/env php
+<?php
+/**
+ * This script outputs statistics on the current memcache pool.
+ *
+ * Usage: stats.php [--all] [--flush] [--lookup=key] [--raw] [--summary]
+ *
+ * By default, shows statistics for all servers.
+ *
+ * Copyright 2007-2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author Michael Slusarz <slusarz@horde.org>
+ */
+
+require_once dirname(__FILE__) . '/../lib/Application.php';
+Horde_Registry::appInit('horde', array('authentication' => 'none', 'cli' => true));
+
+/* Make sure there's no compression. */
+@ob_end_clean();
+
+$c = new Console_Getopt();
+$argv = $c->readPHPArgv();
+array_shift($argv);
+$options = $c->getopt2($argv, '', array('all', 'flush', 'lookup=', 'raw', 'summary'));
+if (PEAR::isError($options)) {
+ $cli->writeln($cli->red("ERROR: Invalid arguments."));
+ exit;
+}
+
+$all = $raw = $summary = false;
+$memcache = $injector->getInstance('Horde_Memcache');
+
+foreach ($options[0] as $val) {
+ switch ($val[0]) {
+ case '--all':
+ $all = true;
+ break;
+
+ case '--flush':
+ if ($cli->prompt($cli->red('Are you sure you want to flush all data?'), array('y' => 'Yes', 'n' => 'No'), 'n') == 'y') {
+ $memcache->flush();
+ $cli->writeln($cli->green('Done.'));
+ }
+ exit;
+
+ case '--lookup':
+ $data = $memcache->get($val[1]);
+ if (!empty($data)) {
+ $cli->writeln(print_r($data, true));
+ } else {
+ $cli->writeln('[Key not found.]');
+ }
+ exit;
+
+ case '--raw':
+ $raw = true;
+ break;
+
+ case '--summary':
+ $summary = true;
+ break;
+ }
+}
+
+$stats = $memcache->stats();
+
+if ($raw) {
+ $cli->writeln(print_r($stats, true));
+} elseif (!$summary) {
+ $all = true;
+}
+
+if ($all || $summary) {
+ if ($summary) {
+ $total = array();
+ $total_keys = array('bytes', 'limit_maxbytes', 'curr_items', 'total_items', 'get_hits', 'get_misses', 'curr_connections', 'bytes_read', 'bytes_written');
+ foreach ($total_keys as $key) {
+ $total[$key] = 0;
+ }
+ }
+
+ $i = $s_count = count($stats);
+
+ foreach ($stats as $key => $val) {
+ if ($summary) {
+ foreach ($total_keys as $k) {
+ $total[$k] += $val[$k];
+ }
+ }
+
+ if ($all) {
+ $cli->writeln($cli->green('Server: ' . $key . ' (Version: ' . $val['version'] . ' - ' . $val['threads'] . ' thread(s))'));
+ _outputInfo($val, $cli);
+ if (--$i || $summary) {
+ $cli->writeln();
+ }
+ }
+ }
+
+ if ($summary) {
+ $cli->writeln($cli->green('Memcache pool (' . $s_count . ' server(s))'));
+ _outputInfo($total, $cli);
+ }
+}
+
+function _outputInfo($val, $cli)
+{
+ $cli->writeln($cli->indent('Size: ' . sprintf("%0.2f", $val['bytes'] / 1048576) . ' MB (Max: ' . sprintf("%0.2f", ($val['limit_maxbytes']) / 1048576) . ' MB - ' . ((!empty($val['limit_maxbytes']) ? round(($val['bytes'] / $val['limit_maxbytes']) * 100, 1) : 'N/A')) . '% used)'));
+ $cli->writeln($cli->indent('Items: ' . $val['curr_items'] . ' (Total: ' . $val['total_items'] . ')'));
+ $cli->writeln($cli->indent('Cache Ratio: ' . $val['get_hits'] . ' hits, ' . $val['get_misses'] . ' misses'));
+ $cli->writeln($cli->indent('Connections: ' . $val['curr_connections']));
+ $cli->writeln($cli->indent('Traffic: ' . sprintf("%0.2f", $val['bytes_read'] / 1048576) . ' MB in, ' . sprintf("%0.2f", $val['bytes_written'] / 1048576) . ' MB out'));
+}