1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

composerのライブラリ達にいつもあてたいパッチがあるならワンシェルにしておこう

Posted at

LaravelでRFCに軽く違反してるメアドにメール送ろうとしたら、Swift_RfcComplianceExceptionが発生して送れなかったんですよ。
原因は下記だったんですが、vendor配下って普通git管理しないじゃないですか。
https://stackoverflow.com/questions/1490042/swift-mailer-error-swift-rfccomplianceexception-on-an-email-that-actually-work
だから、リリースする時はcomposer installしたらパッチをあててやんなきゃいけなくて面倒ですよね。
そういう時は、patchファイルを用意して、patchコマンドを実行ってのもいいですが、なんかサクッと実行したいので、1つのshにするのがおすすめ!

$PROJECT_ROOT/vendor.patch.sh
#!/bin/bash
patch app/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php <<'PATCH'
355,357c355,357
<             throw new Swift_RfcComplianceException(
<                 'Address in mailbox given ['.$address.'] does not comply with RFC 2822, 3.6.2.'
<             );
---
> //            throw new Swift_RfcComplianceException(
> //                'Address in mailbox given ['.$address.'] does not comply with RFC 2822, 3.6.2.'
> //            );
PATCH

# 他にpatchが増えたら追記しよう

邪魔にならなく控え目でいいでしょ?

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?