openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a95894c1faca0f9810ce7e23dd5629e10a2b7bd0
parent af88863c2da8593a56782174d8d9ff6031d4868c
Author: dankert <devnull@localhost>
Date:   Wed, 20 Jan 2010 00:12:15 +0100

Neues Shellscript zum Verschlanken der OpenRat-Installation.

Diffstat:
doc/examples/maintenance/compact.sh | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+), 0 deletions(-)

diff --git a/doc/examples/maintenance/compact.sh b/doc/examples/maintenance/compact.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# This script minimizes the OpenRat Installation. It +# - minimizes CSS files while removing all whitespace +# - minimizes PHP files +# - deletes directories which are only for development +# +# The whole installation is copied to a new subdirectory +# named 'compact'. +# +# Usage: +# Call 'compact.sh' in the openrat installation directory + +minimize_php() { + cat $1 | tr -d \\n > $1 +} + + +minimize_css() { + cat $1 | tr -d \\n | tr -d [:blank:] > $1 +} + +if [ ! -d themes/default/pages ]; then + echo "not an openrat directory. please execute this script in openrat program directory" + exit 4 +fi + +if [ -d compact ]; then + echo "please delete compact-dir" + exit 4 +fi + +mkdir compact + +cp -r * compact +cd compact + +rm -r themes/default/templates +rm -r themes/default/include + +for i in `find -name *.class.php`; do + minimize_php $i +done + +for i in `find -name *.css`; do + minimize_css $i +done + +cd .. + +exit 0 + +