Created
July 16, 2015 23:41
-
-
Save mfrost503/ae44853e27b37f73c09f to your computer and use it in GitHub Desktop.
One Liners from the mail conversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Find all the files that in the directory that and 1 directory deeper that were using mail | |
find ./ -maxdepth 2 -type f -name '*.php' -print0 | xargs -0 grep -l \!mail\( | xargs sed -i "3i require_once \'..\/path\/to\/sendgrid\';" | |
## 3rd line put it after the <?php and session_start(); | |
## Find all the files that have the sendGrid.php require and aren't using the sendGridMail function | |
find ./ -maxdepth 2 -type f -print '*.php' -print0 | xargs -0 grep -l sendGrid\.php | xargs grep -L sendGridMail\( | xargs sed -i 's/\!mail\(/\!sendGridMail\(/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment