Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PHP入門

Takayuki
November 14, 2019

 PHP入門

PHP入門

Takayuki

November 14, 2019
Tweet

More Decks by Takayuki

Other Decks in Programming

Transcript

  1. 1.ࣗݾ঺հ ◆໊લ ླ໦ ޹೭(Suzuki Takayuki) ※ಉ੏ಉ໊ଟͯ͘ࠔͬͯ·͢ɻɻɻ ◆ࣗݾ঺հ ɾ1990೥ɺਆಸ઒ݝੜ·Εɻ ɾࣾձਓʹͳ͔ͬͯΒɺϓϩάϥϛϯάΛ࢝ΊΔɻ ɾ2015೥ʹϑϧεϐʔυʹೖࣾ͠ɺ2017೥ʹಠཱɻ

    ɾݱࡏ͸ɺडୗ։ൃΛ΍ΓͭͭɺࣗࣾWebαʔϏεΛ։ൃதɻ ◆झຯ ίεϓϨɺԻָϥΠϒɺϚϥιϯେձʹग़Δɺ໺ٿ؍ઓ ◆εΩϧ PHP,Symfony2,CakePHP3,Laravel5, JavaScript,backbone.js,Angular.js
  2. Copyright Re:Build.inc All Rights Reserved. 1.ձࣾ঺հ ◆ձ໊ࣾ גࣜձࣾRe:Build ◆ॅॴ ԭೄݝԭೄࢢதԝ̍ஸ໨̍̒−̕

    ◆ࣄۀ಺༰ ɾࣗࣾWEBαʔϏεͷاըɾ։ൃɻ ɾडୗ։ൃ ◆ࣾһ 6໊ ◆ΤϯδχΞͷಇ͖ํ ϦϞʔτϫʔΫՄೳͳࣗ༝ͳಇ͖ํΛਪ঑ͯ͠·͢ʂ
  3. PHP1 PHP5.3 PHP5.6 PHP7 1994 ೥ʹ Rasmus Lerdorf ͕ΦϯϥΠϯ Ͱެ։͍ͯ͠Δܦྺ

    ॻͷΞΫηεཤྺΛ ௐ΂ΔͨΊʹ࢖ΘΕ ͍ͯ·͕ͨ͠ɺ ൴͸ ͦͷεΫϦϓτ܈Λ ʮPersonal Home Page Toolsʯͱ໊෇ ͚·ͨ͠ɻ ɾ໊લۭؒͳͲ΋࢖͑ ΔΑ͏ʹͳͬͯɺ΍ͬ ͱαʔόαΠυͰ։ൃ ͠΍͘͢ͳͬͨɻ ɾ໊લۭؒͷαϙʔ τɺ ੩త஗Ԇଋറɺ gotoԋࢉࢠɺΫϩʔδϟɺ PHPΞʔΧΠϒ (phar)ɺ ॥؀ࢀরʹର͢ΔΨϕʔ δίϨΫγϣϯ ఆ਺ࣜɺՄม௕Ҿ਺ؔ ਺ɺҾ਺ͷల։ԋࢉࢠ (...)ɺྦྷ৐ԋࢉࢠ(**)ɺ ఆ਺ͱؔ਺ʹର͢Δ useจɺର࿩ܕσόο ΨphpdbgΛSAPIϞ δϡʔϧͱͯ͠όϯυ ϧɺͦͷଞࡉ͔ͳվળɻ ɾPHP5ܥͱPHP7ܥͷ ଎౓͸2ഒҎ্ߴ଎ʹ ͳͬͨ ɾnull߹ମԋࢉࢠ??ɺ ؔ਺ͷ໭Γ஋ͷએݴߏ จ[16]ɺεΧϥʔܕͷ λΠϓώϯςΟϯάɺ Ӊ஦ધԋࢉࢠ<=> PHPͷྺ࢙ 1995-06-08 2009-06-30 2014-08-28 2015-12-03 https://ja.wikipedia.org/wiki/PHP_(%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E8%A8%80%E8%AA%9E)
  4. ฐࣾͰͷ-BSBWFM࣮຿·Ͱͷ4UFQ εΫʔϧ΍ಠֶͰHTMLɺ CSSɺJS͘Β͍͸΍͓ͬͯ ͍ͯ΋Β͏ ݚमᶃ ੜͷPHPͰಠࣗϑϨʔϜϫʔ ΫͰܝࣔ൘੍࡞ ݚमᶄ LaravelͰϒϩά੍࡞ ݚमᶅ

    LaravelͰ࣮຿ 200࣌ؒ 300࣌ؒ (2ϲ݄ΠϯλʔϯͰݚम) 300࣌ؒ (2ϲ݄ΠϯλʔϯͰݚम) - ࠷ॳͷಠࣗϑϨʔϜϫʔΫͷ෦෼͸ઌഐ͕͋Δఔ౓ɺ ுΓ෇͍ͯڭ͑ͳ͍ͱɺڭࡐͱͯ͠ͷఏڙ͕೉͍͠ɻ - Laravel͸σΟϨΫτϦߏ଄ͳͲΛࣗ༝ʹ͍͡ΕΔ෼ɺ ॳֶऀʹͱͬͯ͸ɺࠞཚ͕ͪ͠ͳͷͰɺ਎ۙʹฉ͚Δ ਓ͕͍ͳ͍ͱݫͦ͠͏ OJT։࢝
  5. ݚमᶃ ੜͷPHPͰಠࣗϑϨʔϜϫʔΫͰϒϩά੍࡞ # PHPͰͷϒϩά࡞੒ݚम ## ཁ݅ - ੜͷPHPͷΈͰ࡞੒͢Δ͜ͱ(ϑϨʔϜϫʔΫ͸࢖Θͳ͍) ## ػೳҰཡ

    ɹ- Ϣʔβొ࿥ػೳ ɹ- ϩάΠϯػೳ ɹ- ϩάΞ΢τػೳ ɹ- هࣄొ࿥ػೳ ɹ- هࣄ࡟আػೳ ɹ- هࣄݕࡧػೳ ɹ- هࣄฤूػೳ ɹ- هࣄҰཡϖʔδϯάػೳ ɹ- ΧςΰϦొ࿥ػೳ ɹ- ΧςΰϦ࡟আػೳ ɹ- ΧςΰϦฤूػೳ ɹ- ΧςΰϦҰཡػೳ ɹ- λάొ࿥ػೳ ɹ- λά࡟আػೳ ɹ- λάฤूػೳ ɹ- λάҰཡػೳ ## ηΩϡϦςΟରࡦ ɹ- CSRFରࡦग़དྷ͍ͯΔࣄ ɹ- XSSରࡦ͕ग़དྷ͍ͯΔࣄ ɹ- SQLΠϯδΣΫγϣϯରࡦ͕ग़དྷ͍ͯΔࣄ ## MVCϞσϧ͕࣮ݱͰ͖͍ͯΔ͜ͱ ## ֤ೖྗ߲໨ʹରͯ͠όϦσʔγϣϯ͕ग़དྷ͍ͯΔࣄ(PHPଆͰߦ͏) - ඞਢνΣοΫ - ਺ࣈνΣοΫ - ϝʔϧΞυϨεܗࣜνΣοΫͳͲ ## PSR2ʹ४ڌ͍ͯ͠Δ͜ͱ ## ࢖༻͢Δٕज़ php7,apache,mysql ## ظݶ ◦/◦◦·Ͱ
  6. ݚमᶄ LaravelͰCRUDΞϓϦ࡞੒ # LaravelͰͷCRUDΞϓϦ࡞੒ݚम ## ཁ݅ - LaravelͰCRUDͷ͋ΔΞϓϦΛ࡞੒͢Δࣄ - جຊతʹ͸ࣗ෼ͷΞΠσΟΞͰ࡞Γ͍ͨΞϓϦΛ࡞੒͢Δ

    - ྫɿTwitterͬΆ͍ΞϓϦɺཱྀߦઌ৘ใετοΫΞϓϦͳͲɻ - ࣗ෼Ͱը໘ઃܭɺDBઃܭ͔Βߦ͏ɻ - ࣗ෼Ͱ࡞Γ͍ͨΞϓϦΛ࡞Δ͜ͱͰ։ൃ͢Δ͜ͱͷָ͠͞Λ஌ͬͯ΋Β͏ɻ