Skip to content

Commit

Permalink
Merge pull request #4 from totten/seamuslee001-CRM-20561
Browse files Browse the repository at this point in the history
CRM-20561 - Remove example files. Cleanup code style.
  • Loading branch information
seamuslee001 authored Jun 16, 2017
2 parents e737bf0 + 23e72ac commit 37fcf8d
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions tools/scripts/composer/net-smtp-fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,32 @@
## Replace a line in a file
## This is a bit like 'sed -i', but dumber and more cross-platform.

##############################################################################
## usage: safe_delete <relpath...>
function safe_delete() {
for file in "$@" ; do
if [ -z "$file" ]; then
echo "Skip: empty file name"
elif [ -e "$file" ]; then
rm -rf "$file"
fi
done
}


##############################################################################
# Add in CiviCRM custom error message for CRM-8744.
if ! grep -q 'CRM-8744' vendor/pear/net_smtp/Net/SMTP.php; then
patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-patch.txt
patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-patch.txt
fi
if ! grep -q '@STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT' vendor/pear/net_smtp/Net/SMTP.php; then
patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-tls-patch.txt
patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-tls-patch.txt
fi
if ! grep -q 'function __construct' vendor/pear/net_smtp/Net/SMTP.php; then
patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-php7-patch.txt
patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-php7-patch.txt
fi
if grep -q '&Auth_SASL::factory' vendor/pear/net_smtp/Net/SMTP.php; then
patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-ref-patch.txt
fi
patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-ref-patch.txt
fi

safe_delete vendor/pear/net_smtp/{examples,phpdoc.sh,tests}

0 comments on commit 37fcf8d

Please sign in to comment.