Slide 1

Slide 1 text

PHPະܦݧऀΛҭͯΔ ಠࣗϑϨʔϜϫʔΫͷ࡞Γํ ླ໦޹೭

Slide 2

Slide 2 text

Agenda 2.ฐࣾͰͷΤϯδχΞͷҭͯํ 1.ࣗݾ঺հɾձࣾ঺հ 3.ݚम಺༰

Slide 3

Slide 3 text

ࣗݾ঺հɾձࣾ঺հ

Slide 4

Slide 4 text

Copyright Re:Build.inc All Rights Reserved. ࣗݾ঺հ 1 ◆໊લ ླ໦ ޹೭(Suzuki Takayuki) ※ಉ੏ಉ໊ଟͯ͘ࠔͬͯ·͢ɻɻɻ ◆ࣗݾ঺հ ɾ1990೥ɺਆಸ઒ݝੜ·Εɻ ɾࣾձਓʹͳ͔ͬͯΒɺϓϩάϥϛϯάΛ࢝ΊΔɻ ɾ2015೥ʹϑϧεϐʔυʹೖࣾ͠ɺ2017೥ʹಠཱɻ ɾϑϦʔϥϯεͰϦϞʔτϫʔΫΛ൒೥΄Ͳ΍ͬͨޙʹԭೄͰىۀ ◆झຯ ίεϓϨɺԻָϥΠϒɺϚϥιϯେձʹग़Δɺ໺ٿ؍ઓ ◆εΩϧ ɾPHP, Symfony2,CakePHP3,Laravel6 ɾJavaScript, backbone.js,Angular4,Vue.js,Nuxt.js BDD(Ϗʔνۦಈ։ൃ)

Slide 5

Slide 5 text

Copyright Re:Build.inc All Rights Reserved. 1 ࣗݾ঺հ

Slide 6

Slide 6 text

Copyright Re:Build.inc All Rights Reserved. ձࣾ঺հ 1 ◆ձ໊ࣾ גࣜձࣾRe:Build ◆ॅॴ ԭೄݝಹ೼ࢢٱໜ஍2-2-2 λΠϜεϏϧ ◆ࣄۀ಺༰ ɾࣗࣾWEBαʔϏεͷاըɾ։ൃɻ ɾडୗ։ൃ ◆ࣾһ 7໊ ◆ΤϯδχΞͷಇ͖ํ ϦϞʔτϫʔΫՄೳͳࣗ༝ͳಇ͖ํΛਪ঑ͯ͠·͢ʂ

Slide 7

Slide 7 text

Copyright Re:Build.inc All Rights Reserved. 7 ɾαʔϏε໊ Tadoru
 https://tadoru.work/
 
 ɾγεςϜ֓ཁ ΤϯδχΞಛԽܕͷ ϦϑΝϥϧ Ϋϥ΢υιʔγϯά 1 ձࣾ঺հ

Slide 8

Slide 8 text

ฐࣾͰͷΤϯδχΞͷҭͯํ

Slide 9

Slide 9 text

ೖࣾ࣌ͷ͍͍ͩͨͷଐੑɾεΩϧηοτ ୈೋ৽ଔͰ20୅લ൒ ͘Β͍͕த৺ HTML,CSS,JS͸ษڧ͍ͯ͠Δɻ ϓϩάϥϛϯάεΫʔϧͷॳڃฤ͸ ऴΘ͍ͬͯΔ͘Β͍ͷΠϝʔδ ࣾձਓͷجૅεΩϧ͸͋Δɻ ΤϯδχΞͱͯ͠ͷ։ൃ࣮຿͸ະܦ ݧɻ

Slide 10

Slide 10 text

ฐࣾͰͷ-BSBWFM࣮຿·Ͱͷ4UFQ εΫʔϧ΍ಠֶͰHTMLɺ CSSɺJS͘Β͍͸΍͓ͬͯ ͍ͯ΋Β͏ ݚमᶃ ੜͷPHPͰಠࣗ ϑϨʔϜϫʔΫͰϒϩά੍࡞ ݚमᶄ LaravelͰϒϩά੍࡞ ݚमᶅ LaravelͰ࣮຿ 200࣌ؒ 150࣌ؒ~300࣌ؒ (2ϲ݄ΠϯλʔϯͰݚम) ਓʹΑͬͯਐḿΛݟͯมಈ 300࣌ؒ (2ϲ݄ΠϯλʔϯͰݚम) OJT։࢝

Slide 11

Slide 11 text

2.ฐࣾͰͷະܦݧΤϯδχΞͷҭͯํ ݚमͰ͸Լهͷ߲໨Λॏ఺తʹڭ͑Δ 1.࣭໰ͷ࢓ํ 2.ࣗݾεέδϡʔϧ؅ཧ 3.άάΔྗ 4.ϑϨʔϜϫʔΫʹґଘ͠ͳ͍ਂ͍ཧղ

Slide 12

Slide 12 text

2.ฐࣾͰͷະܦݧΤϯδχΞͷҭͯํ ࣾ಺Ͱͷڭҭମ੍ɺจԽͮ͘Γʹ͍ͭͯͷ޻෉ 1.ݚम୲౰ऀΛଐਓԽͤ͞ͳ͍ɻϝΠϯ୲౰ऀ͸͚ͭΔ ͕ɺ୭Ͱ΋ڭ͑ͯOKͷମ੍ʹ͢Δɻ 2.ձࣾͱͯ͠৽ਓʹڭ͑ΔจԽΛఆணͤ͞Δɻ 3.৽ਓڭҭΛධՁ੍౓ʹ΋૊ΈࠐΉɻ 4.ݚमੜʹݚमҎ֎ͷࡶ຿ΛͳΔ΂͘ɺ΍Βͤͳ͍ɻ

Slide 13

Slide 13 text

ݚम಺༰

Slide 14

Slide 14 text

ݚम಺༰ ੜͷPHPͰಠࣗϑϨʔϜϫʔΫͰϒϩά੍࡞ # PHPͰͷϒϩά࡞੒ݚम ## ཁ݅ - ੜͷPHPͷΈͰ࡞੒͢Δ͜ͱ(ϑϨʔϜϫʔΫ͸࢖Θͳ͍) ## ػೳҰཡ ɹ- Ϣʔβొ࿥ػೳ ɹ- ϩάΠϯػೳ ɹ- ϩάΞ΢τػೳ ɹ- هࣄొ࿥ػೳ ɹ- هࣄ࡟আػೳ ɹ- هࣄݕࡧػೳ ɹ- هࣄฤूػೳ ɹ- هࣄҰཡϖʔδϯάػೳ ɹ- ΧςΰϦొ࿥ػೳ ɹ- ΧςΰϦ࡟আػೳ ɹ- ΧςΰϦฤूػೳ ɹ- ΧςΰϦҰཡػೳ ɹ- λάొ࿥ػೳ ɹ- λά࡟আػೳ ɹ- λάฤूػೳ ɹ- λάҰཡػೳ ## ηΩϡϦςΟରࡦ ɹ- CSRFରࡦग़དྷ͍ͯΔࣄ ɹ- XSSରࡦ͕ग़དྷ͍ͯΔࣄ ɹ- SQLΠϯδΣΫγϣϯରࡦ͕ग़དྷ͍ͯΔࣄ ## MVCϞσϧ͕࣮ݱͰ͖͍ͯΔ͜ͱ ## ֤ೖྗ߲໨ʹରͯ͠όϦσʔγϣϯ͕ग़དྷ͍ͯΔࣄ(PHPଆͰߦ͏) - ඞਢνΣοΫ - ਺ࣈνΣοΫ - ϝʔϧΞυϨεܗࣜνΣοΫͳͲ ## psr-12ʹ४ڌ͍ͯ͠Δ͔ https://www.php-fig.org/psr/psr-12/ ## ࢖༻͢Δٕज़ php7,apache,mysql ## ظݶ ○/○○·Ͱ

Slide 15

Slide 15 text

RubyͰݴ͏Sinatraʹ͍ۙͪΐ͏Ͳྑ͍ϑϨʔϜϫʔΫ͕ແ͍(Slim͕͍͕ۙυΩϡ ϝϯτ͕গͳ͍)ͷ΋͋ΓɺಠࣗϑϨʔϜϫʔΫͷΧϦΩϡϥϜΛ΍͍ͬͯ·͢ɻ PHPجૅ ಠࣗϑϨʔϜϫʔΫ Laravel - ͔ͬ͠Γͱͨ͠
 νϡʔτϦΞϧ͸·ͩແ͍ Rubyجૅ Sinatra Rails - RailsνϡʔτϦΞϧ Rails Laravel ͳͥੜͷ1)1ͰಠࣗϑϨʔϜϫʔΫΛ΍Δͷ͔ʁ Rubyͷܰྔ ϑϨʔϜϫʔΫ

Slide 16

Slide 16 text

͜ΕΒΛڭ͑ͳ͍ͱԿʹࠔΔͷ͔ʁ CSRFτʔΫϯͬͯͷͰΤϥʔ͕ग़ ͯͨΜͰɺτʔΫϯফͯ͠Έ·ͨ͠ʂ XSSରࡦͬͯԿͰ͔͢ʁ ViewͰมͳؔ਺ݺ͹ΕͯͨͷͰɺফ͓͖ͯ͠ ·ͨ͠ʂ ORMͷfindϝιουͰ্ख͘σʔλ औΕͳ͍ΜͰ͕͢ɺSQLͲ͏͢Ε͹ ྑ͍Ͱ͔͢ʁ

Slide 17

Slide 17 text

ϒϩάΞϓϦ࡞੒ͷաఔ ①PHPͰϑΥʔϜ͔ΒσʔλΛड͚औͬͯΈΔʢGETͱPOSTʣ ②ঃʑʹϒϩάΞϓϦΛ࡞͍ͬͯ͘ɻ ③MVCԽ͢Δ ④ηΩϡϦςΟରࡦΛࣗ࡞ͰೖΕΔ ϨϏϡʔ ϨϏϡʔ

Slide 18

Slide 18 text

ݚम ੜͷPHPͰಠࣗϑϨʔϜϫʔΫͰϒϩά੍࡞ index.php router controller Model View Database 1 2 3 4 5 9 6 7 8 DB͔ΒσʔλΛऔಘ σʔλΛऔಘ όΠϯυͨ͠HTMLΛฦ٫ σʔλΛHTMLʹόΠϯυ HTMLΛฦ٫ ࠷ॳ͸index.phpΛ ܦ༝͢Δ /loginͷURL͕ ୟ͔ΕΔ URLʹඥͮ͘ Controller͸ݺ͹ΕΔ શମߏ੒ਤ ਤͷࢀߟ:https://railstutorial.jp/chapters/toy_app?version=4.2

Slide 19

Slide 19 text

ݚम ੜͷPHPͰಠࣗϑϨʔϜϫʔΫͰϒϩά੍࡞ index.php router controller Model View Database 1 2 3 4 5 9 6 7 8 DB͔ΒσʔλΛऔಘ σʔλΛऔಘ όΠϯυͨ͠HTMLΛฦ٫ σʔλΛHTMLʹόΠϯυ HTMLΛฦ٫ ࠷ॳ͸index.phpΛ ܦ༝͢Δ /loginͷURL͕ ୟ͔ΕΔ URLʹඥͮ͘ Controller͸ݺ͹ΕΔ શମߏ੒ਤ ਤͷࢀߟ:https://railstutorial.jp/chapters/toy_app?version=4.2 ໾ׂ ɾΤϯτϦʔϙΠϯτ ɾΦʔτϩʔυ ɾrouterΛݺͼग़͢

Slide 20

Slide 20 text

ݚम ੜͷPHPͰಠࣗϑϨʔϜϫʔΫͰϒϩά੍࡞ index.php router controller Model View Database 1 2 3 4 5 9 6 7 8 DB͔ΒσʔλΛऔಘ σʔλΛऔಘ όΠϯυͨ͠HTMLΛฦ٫ σʔλΛHTMLʹόΠϯυ HTMLΛฦ٫ ࠷ॳ͸index.phpΛ ܦ༝͢Δ /loginͷURL͕ ୟ͔ΕΔ URLʹඥͮ͘ Controller͸ݺ͹ΕΔ શମߏ੒ਤ ਤͷࢀߟ:https://railstutorial.jp/chapters/toy_app?version=4.2 ޻෉఺ ɾCSRFରࡦೖΕΔ ɾϩάΠϯνΣοΫೖΕΔ ͳͲ

Slide 21

Slide 21 text

ݚम ੜͷPHPͰಠࣗϑϨʔϜϫʔΫͰϒϩά੍࡞ ࣗ࡞routingͷྫ ແཧ͘Γ΍͍ͬͯ Δ͕ɺ΋ͬͱ៉ྷ ʹ͸ॻ͚ͦ͏…ɻ

Slide 22

Slide 22 text

ݚम ੜͷPHPͰಠࣗϑϨʔϜϫʔΫͰϒϩά੍࡞ Modelͷྫ ඞཁͳDB઀ଓͷઃ ఆͳͲ͸਌ͷModel ʹ·ͱΊΔɻ ܧঝ

Slide 23

Slide 23 text

ݚम ੜͷPHPͰಠࣗϑϨʔϜϫʔΫͰϒϩά੍࡞ ׬੒Πϝʔδ

Slide 24

Slide 24 text

ݚम ੜͷPHPͰಠࣗϑϨʔϜϫʔΫͰϒϩά੍࡞ ׬੒Πϝʔδ

Slide 25

Slide 25 text

ݚम ੜͷPHPͰಠࣗϑϨʔϜϫʔΫͰϒϩά੍࡞ ׬੒Πϝʔδ

Slide 26

Slide 26 text

·ͱΊ

Slide 27

Slide 27 text

·ͱΊ ɾϑϨʔϜϫʔΫʹґଘ͠ͳ͍ਂ͍PHPͷཧղͯ͠΋Β͍ɺ௕ظతͳ໨ઢ Ͱ༏लͳΤϯδχΞΛҭͯΔɻ ɾখن໛ͷձࣾͰະܦݧΤϯδχΞΛड͚ೖΕΔ৔߹͸ɺ ࣾ಺Ͱͷڭҭମ੍΍จԽͮ͘Γ͕େ੾ɻ ɾฐࣾͰͷPHPಠࣗϑϨʔϜϫʔΫݚम͸ΦʔμʔϝΠυཁૉ͕ڧ͍ͷͰ େਓ਺Ͱͷݚम͸޲͍͍ͯͳ͍͕ɺ࣮֬ʹ1~2ਓΛݚम͢Δʹ͸ޮՌΛൃ ش͢Δͱࢥ͍·͢ɻ

Slide 28

Slide 28 text

ࠂ஌ 2020೥6~7݄ࠒʹ ϑϩϯτΤϯυΧϯϑΝ ϨϯεԭೄΛ։࠵༧ఆʂ

Slide 29

Slide 29 text

ࠂ஌ 2020೥10݄ࠒʹ PHPΧϯϑΝϨϯε ԭೄΛ։࠵༧ఆʂ