#!/bin/sh
#####################################################################
#                                                                   #
# Check system dependences between php-pear modules                 #
#                                                                   #
# Pawe Goaszewski <blues@ds.pg.gda.pl>                            #
# ------------------------------------------------------------------#
# TODO:                                                             #
#####################################################################

if [ $# -lt 1 ]; then
	echo "You have to specify input file"
	exit 1
fi

filelist=`echo $@`
for i in $filelist; do
	i=`echo $i | grep "\.php$"`
	if [ -n "$i" ]; then
		j=`cat $i | egrep  -i "^Class" | cut -f 2 -d " " |  sed "s/{/ /" | tr -d "\r"`
		if [ -n "$j" ]; then
			for p in $j; do
				echo "pear($p)"
			done
			j=""
		fi
	fi
done
