#!/bin/sh
# Written by Marius van Witzenburg <info@mariusvw.com>
path="."
if [ ! -z "$1" ] && [ -d "$1" ]
then
path="$1"
elif [ ! -z "$1" ]
then
echo "Invalid path defined, using default."
fi
echo "Searching for php short open tags…"
echo "Starting path: $path"
find $path -name '*.php' -type f -exec perl -i -wpe 's/<\?=/<\?php echo /g' '{}' \;
find $path -name '*.php' -type f -exec perl -i -wpe 's/<\?/<\?php/g' '{}' \;
find $path -name '*.php' -type f -exec perl -i -wpe 's/<\?phpphp/<\?php/g' '{}' \;
find $path -name '*.ctp' -type f -exec perl -i -wpe 's/<\?=/<\?php echo /g' '{}' \;
find $path -name '*.ctp' -type f -exec perl -i -wpe 's/<\?/<\?php/g' '{}' \;
find $path -name '*.ctp' -type f -exec perl -i -wpe 's/<\?phpphp/<\?php/g' '{}' \;
find $path -name '*.inc' -type f -exec perl -i -wpe 's/<\?=/<\?php echo /g' '{}' \;
find $path -name '*.inc' -type f -exec perl -i -wpe 's/<\?/<\?php/g' '{}' \;
find $path -name '*.inc' -type f -exec perl -i -wpe 's/<\?phpphp/<\?php/g' '{}' \;
find $path -name '*.thtml' -type f -exec perl -i -wpe 's/<\?=/<\?php echo /g' '{}' \;
find $path -name '*.thtml' -type f -exec perl -i -wpe 's/<\?/<\?php/g' '{}' \;
find $path -name '*.thtml' -type f -exec perl -i -wpe 's/<\?phpphp/<\?php/g' '{}' \;
echo 'Done!'
http://mariusvw.com/2010/03/03/easy-replace-php-short-open-tags-with-long-php-open-tags/
Check all PHP files in the current directory
Check all PHP files in the current directory and all subdirectories
Find word in php files
Find php short tags in php files
Adminer (formerly phpMinAdmin) is a full-featured MySQL management tool written in PHP. Conversely to phpMyAdmin, it consist of a single file ready to deploy to the target server






Recent Comments