Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-20561 - Remove example files. Cleanup code style. #4

Merged
merged 2 commits into from
Jun 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}