#!/bin/bash
#
# This script will check if your code matches the guidelines
# @remark: make sure your CLI has enough memory, I hacked the phpcs-file
#
# 1. sudo vim /usr/bin/phpcs
# 2. added "ini_set('memory_limit', '2048M');"
#
# @version	1.0.0
# @author	Tijs Verkoyen <tijs@sumocoders.be>

# check if phpcs is installed
type -P phpcs &>/dev/null || { echo "PHP CodeSniffer is not installed, run 'pear install PHP_CodeSniffer'." >&2; exit 1; }

# determine the relevant directories
base_dir="$(dirname "$0")/..";

# run it
phpcs -v --standard="../tools/codesniffer/Fork" --ignore=../default_www/backend/core/js/tiny_mce,../default_www/frontend/cache,../default_www/backend/cache,../default_www/install/cache,../default_www/docs,../default_www/markup,../tools,../library/external,../library/spoon --extensions=php --report=full "${@:-..}"