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

プラグインでのDBALベストプラクティスについて #1328

Closed
ttsuru opened this issue Dec 15, 2015 · 7 comments
Closed

プラグインでのDBALベストプラクティスについて #1328

ttsuru opened this issue Dec 15, 2015 · 7 comments
Labels
document Improvements or additions to documentation

Comments

@ttsuru
Copy link
Contributor

ttsuru commented Dec 15, 2015

現状、プラグインのマイグレーション時に、 executeUpdate() を利用していますが、変数をそのままSQL文に入れるなど、あまりよいとは言えない例が多くあります。

・冪等性を考慮したアップデートについて
http://qiita.com/iakio/items/adf1f923d1cfccbba765
こちらにあるような形が良いかと思います。

・INSERT または UPDATE について
現状、なぜか executeUpdate を利用していますが、こちらは insert もしくは update のほうが安全にSQLを実行できます。

http://doctrine-orm.readthedocs.org/projects/doctrine-dbal/en/latest/reference/data-retrieval-and-manipulation.html

@ttsuru
Copy link
Contributor Author

ttsuru commented Dec 15, 2015

他にもありますが、ぜひ、migration自体のベストプラクティスを定義していった方が良いかと思います。

@nanasess
Copy link
Contributor

本当は、やっちゃいけないのかもしれませんが、こんなことを試みたことがあります。
nanasess@e42ee29

migration のベストプラクティスを定義しない理由は無いと思いますが、リソースがそこまで追いついていないのが実情かと...

@ttsuru
Copy link
Contributor Author

ttsuru commented Dec 15, 2015

@nanasess
気づいたタイミングでは何らかのアクションを起こしていますが、現状、プラグイン作成者によっては危険な表記が多い点が非常に気になります。

@nanasess nanasess added the document Improvements or additions to documentation label Dec 15, 2015
@Yangsin
Copy link

Yangsin commented Dec 15, 2015

何がベストプラティクスとして定義できるかも、用意でききれていないのですが、2系でプラグイン開発時のセキュリティガイド作ったように、そうしていきたいのは山々です。
https://github.com/EC-CUBE/ec-cube.github.io
へも、お気づきの点などご協力いただけると助かります

@ttsuru
Copy link
Contributor Author

ttsuru commented Dec 15, 2015

@Yangsin
どこかのタイミングで整理します。

@chihiro-adachi
Copy link
Contributor

ec-cube.github.ioにマイグレーションの作成についてissue起案しました
EC-CUBE/ec-cube.github.io#71

@ryo-endo
Copy link
Contributor

上記のとおり、github.io側にIssue作成させていただきましたので、こちらはCLOSEさせていただきます。
EC-CUBE/ec-cube.github.io#71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants