return $langs;
}
+function search_applications()
+{
+ $dirs = array();
+ $horde = false;
+ if (is_dir(BASE . DS . 'po')) {
+ $dirs[] = BASE;
+ $horde = true;
+ }
+ $dh = opendir(BASE);
+ if ($dh) {
+ while ($entry = readdir($dh)) {
+ $dir = BASE . DS . $entry;
+ if (is_dir($dir) &&
+ substr($entry, 0, 1) != '.' &&
+ fileinode(HORDE_BASE) != fileinode($dir)) {
+ $sub = opendir($dir);
+ if ($sub) {
+ while ($subentry = readdir($sub)) {
+ if ($subentry == 'po' && is_dir($dir . DS . $subentry)) {
+ $dirs[] = $dir;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return $dirs;
+}
+
function strip_horde($file)
{
if (is_array($file)) {
{
global $cmd_options, $dirs, $apps, $debug, $test, $last_error_msg, $c;
- require_once 'Horde/DOM.php';
-
foreach ($cmd_options[0] as $option) {
switch ($option[0]) {
case 'h':
{
global $cmd_options, $dirs, $apps, $debug, $test, $c;
- require_once 'Horde/DOM.php';
-
foreach ($cmd_options[0] as $option) {
switch ($option[0]) {
case 'h':
check_binaries();
$c->writeln(sprintf('Searching Horde applications in %s', BASE));
-
-$apps = $dirs = array();
-$registry = Horde_Registry::singleton(Horde_Registry::SESSION_NONE);
-foreach ($registry->listApps() as $val) {
- $fileroot = rtrim($registry->get('fileroot', $val), DS);
- if (is_dir($fileroot . DS . 'po')) {
- $apps[] = strip_horde($val);
- $dirs[] = $fileroot;
- }
-}
+$dirs = search_applications();
if ($debug) {
$c->writeln('Found directories:');
$c->writeln(implode("\n", $dirs));
}
+$apps = strip_horde($dirs);
+$apps[0] = 'horde';
$c->writeln(wordwrap(sprintf('Found applications: %s', implode(', ', $apps))));
$c->writeln();