summaryrefslogtreecommitdiff
path: root/plugins/libkolab/bin/get_horde_date.sh
blob: c75b7fd082c91ad7b12177e04e63d88a49042c17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

# Copy Horde_Date_Recurrence classes and dependencies to stdout.
# This will create a standalone copy of the classes requried for date recurrence computation.

SRCDIR=$1

if [ ! -d "$SRCDIR" ]; then
  echo "Usage: get_horde_date.sh SRCDIR"
  echo "Please enter a valid source directory of the Horde libs"
  exit 1
fi

echo "<?php

/**
 * This is a concatenated copy of the following files:
 *   Horde/Date/Utils.php, Horde/Date/Recurrence.php
 * Pull the latest version of these files from the PEAR channel of the Horde
 * project at http://pear.horde.org by installing the Horde_Date package.
 */

if (!class_exists('Horde_Date'))
	require_once(dirname(__FILE__) . '/Horde_Date.php');

// minimal required implementation of Horde_Date_Translation to avoid a huge dependency nightmare
class Horde_Date_Translation
{
	function t(\$arg) { return \$arg; }
	function ngettext(\$sing, \$plur, \$num) { return (\$num > 1 ? \$plur : \$sing); }
}
"

sed 's/<?php//; s/?>//' $SRCDIR/Date/Utils.php
echo "\n"
sed 's/<?php//; s/?>//' $SRCDIR/Date/Recurrence.php | sed -E "s/Horde_String::/strto/"
echo "\n"