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

Drupal 9 Web開発ことはじめ〜なにそれ?おいしいの?

Drupal 9 Web開発ことはじめ〜なにそれ?おいしいの?

OSC2021 Online/Nagoya F会場 14:00-14:45 の発表スライドです。
https://register.ospn.jp/osc2021-online-nagoya/modules/eventrsv/1.html

E0a89ea965a4ac4b5f091d6bd9e8d8ea?s=128

Takahiro Komatsu

May 25, 2021
Tweet

Transcript

  1. Drupal 9 Web։ൃ͜ͱ͸͡Ί Drupal Meetup ๛ాɹখদߴኍ 2021/5/29 OSC2021 Online/Nagoya ͳʹͦΕʁ͓͍͍͠ͷʁ

    1
  2. ࣗݾ঺հ - খদߴኍʢ͜·ͭ ͔ͨͻΖʣ - Ѫ஌ݝמ୩ࢢ - ϑϦʔϥϯεͷΤϯδχΞ - ճ࿏ઃܭɾج൘ઃܭ͔Β

    αʔόߏஙɾΞϓϦ։ൃ·Ͱ޿͘ઙ͘ - ࠷ۙͷڵຯ: Rust / WebAssembly / WebRTC Kubernetes / FPGA / ௿ϨΠϠ / ࣗ࡞OS ίϯύΠϥ / ΞΫηγϏϦςΟ NLP (ࣗવݴޠॲཧ) / KR (஌ࣝදݱ) 2
  3. ๻ͱ Drupal ͱͷग़⁊͍ 3

  4. 2018 / 5 / 9 4

  5. ͱ͋Δ IoT ͷίϛϡχςΟͰ ;ͱ࣭໰͞Εͨ 5

  6. ʮ Drupal ͬͯ஌ͬͯ·͢ʁʯ 6

  7. ͏ʔΜ … ࢒೦ͳ͕Β શ͘ฉ͍ͨ͜ͱͳ͍Ͱ͢Ͷ 😅 7

  8. ʮࠓ౓ Drupal ͷίϛϡχςΟͰ ษڧձΛ࢝ΊΔΜͰ͢ɻ Α͔ͬͨΒࢀՃͯ͠Έ·ͤΜ͔ʁʯ 8

  9. ͳΜ͔͓ͩ΋͠Ζͦ͏ 9

  10. ͻͱ·͓ͣ͏ͪ΁ؼͬͯ Drupal ʹ͍ͭͯௐ΂ͯΈͨ 10

  11. 11

  12. Ͳ͏΍Β … CMSʁΈ͍ͨ 12

  13. ʢิ଍ʣ੩తαΠτ 13 HTTP Server Response Request .html Web Browser

  14. ʢิ଍ʣಈతαΠτ 14 abc 123 DB Server HTTP Server Response Request

    APP Server CMS .html Web Browser
  15. WordPress Έ͍ͨʁ ͳ΋ͷ͔ͳ… 15

  16. Ͱ΋೔ຊޠ৘ใ͕શવͳͯ͘ ͬ͞ͺΓΘ͔Βͳ͍…😢 16

  17. ίϛϡχςΟΠϕϯτʹߦͬͯ ࢖͍ͬͯΔਓʹ௚઀ฉ͍ͯΈΑ͏ 17

  18. Drupal Meetup ๛ా 18

  19. Drupal Meetup ๛ా - 2018/5 ͔Β։࠵ - 2020/4 ͔ΒΦϯϥΠϯ։࠵ -

    Ѫ஌ݝ಺΍ݝ֎ͷDrupalʹڵຯ͋Δ ਓ͕ू·͍ͬͯΔίϛϡχςΟ - ษڧձͱ͍͏ΑΓ͸Drupalؔ࿈ͷ࠲ ஊձͳงғؾ - https://drupal-meetup- toyota.connpass.com 19
  20. Meetup ʹࢀՃͯ͠ΈͨΒ 20

  21. Drupal ͷಛ௃͕ গͣͭ͠෼͔Γ࢝Ίͨ 21

  22. - Φʔϓϯιʔε(GPLv2+)ͷCMS - Dries Buytaert @Dries ͕ PHPͰॻ͖࢝Ίͨ - ॳϦϦʔε

    2001/1/15 - ࠷৽൛ 9.1.9 (2021/5/29 ݱࡏ) 22 https://www.acquia.com/jp/blog/drupal-celebrates-20-years https://www.drupal.org/project/drupal https://www.drupal.org/about/licensing
  23. Drupal 9 ಈ࡞؀ڥ - Apache 2.4.7 Ҏ߱ Nginx 0.7.x Ҏ߱

    - PHP 7.3 Ҏ߱ (Drupal 9.1.0 ͔Β PHP 8 ʹରԠ) - MySQL 5.7.8 Ҏ߱ MariaDB 10.3.7 Ҏ߱ SQLite 3.26 Ҏ߱ PostgreSQL 10 Ҏ߱ (pg_trgm ඞਢ) 23 https://www.drupal.org/docs/user_guide/en/install-requirements.html
  24. CMSγΣΞʢ2021/5/29ݱࡏʣ 24 ˔ WordPress 64.9 % ˔ Shopify 5.5 %

    ˔ Joomla 3.2 % ˔ Squarespace 2.6 % ˔ Wix 2.5 % ˔ Drupal 2.3 % ˔ ͦͷଞ 19.0 % https://w3techs.com/technologies/history_overview/content_management/ms/y
  25. DrupalΛར༻͍ͯ͠ΔαΠτྫʢւ֎ʣ - Pfizer https://www.pfizer.com - Moderna https://www.modernatx.com - Astellas Pharma

    https://www.astellas.com - Tesla https://www.tesla.com 25 - NASA https://www.nasa.gov - Nasdaq https://www.nasdaq.com - University of Oxford https://www.ox.ac.uk - LUSH https://lush.com - IBM https://www.ibm.com - Red Hat https://www.redhat.com - AMD https://www.amd.com - NOKIA https://www.nokia.com
  26. DrupalΛར༻͍ͯ͠ΔαΠτྫʢࠃ಺ʣ - ࡾඛॏ޻ https://www.mhi.com - ࡾҪԽֶ https://jp.mitsuichemicals.com - ژ౎େֶ https://www.kyoto-u.ac.jp

    - ౦ژେֶ ࠃࡍߴ౳ݚڀॴ ΧϒϦ਺෺࿈ܞӉ஦ݚڀػߏ https://www.ipmu.jp/ja 26 - ԭೄՊֶٕज़େֶӃେֶ(OIST) https://www.oist.jp - Think IT https://thinkit.co.jp - খֶؗ https://www.shogakukan.co.jp - ॣՏ԰.JP https://www.suruga-ya.jp
  27. Drupal ͷ޷͖ͳͱ͜Ζ - ػೳΛߏ੒͢Δ֤Ϟδϡʔϧ͕͔ͳΓ௚ަ ʢಉҰػೳͷ GUI ͸ผϞδϡʔϧʹ෼཭ʣ - αΠτϖʔδɾ؅ཧϖʔδ ͦΕͧΕʹݸผͷςʔϚΛઃఆͰ͖Δ

    ʢ؅ཧϖʔδΛઃܭ͠қ͍ʣ - ϢʔβݖݶΛৄࡉʹઃఆͰ͖Δ ʢϫʔΫϑϩʔΛઃܭ͠қ͍ʣ - ଟݴޠԽͷػೳ͕σϑΥϧτͰଘࡏ 27
  28. Drupal is Simple - Simple ≠ Easy - ֓೦͕ચ࿅͞Ε͍ͯΔ =

    ௚ަԽ - Simple ͳ΋ͷ͸ந৅౓͕ߴ͘ͳΔ ʢe.g. ਺ֶɾ෺ཧʣ 28
  29. ίϯςϯπ ≠ Webϖʔδ 29

  30. ίϯςϯπ - text - audio - image - video -

    binary data - ग़དྷ্͕Δ΋ͷ͸ඞͣ͠΋ ʮWebϖʔδʯͱ͸ݶΒͳ͍ 30
  31. ιϑτ΢ΣΞ = σʔλม׵ʢߏ଄Խʣ+ ৘ใϑΟϧλ 31 APP Server DB Server HTTP

    Server abc 123 Drupal
  32. API API Headless / Decoupled architecture 32 Tablet Digital Signage

    APP Server Smart Phone Personal Computer Smart Speaker API SPA / Native App API Drupal abc 123 DB Server
  33. CMSʢContent Management Systemʣ ͱ͍͏ΑΓ͸ CMFʢContent Management Frameworkʣ 33

  34. DXP ʢDigital eXperience Platformʣ 34

  35. ֶशίετ - ॳΊͯ৮Δਓʹ͸Ͳͷ෦෼ͷߏஙΛͯ͠ ͍Δͷ͔ཧղͮ͠Β͍ - Custom Content Type - Taxonomy

    - Views - Block - ઌͷઌΛݟ௨ͨ͠ઃܭΛ͢Δ͜ͱ͸ඇৗ ʹ೉қ౓͕ߴ͍ - ·ͣ͸ͨ͘͞Μʮ࡞ͬͯ͸յ͢ʯܦݧΛ ॏͶΔ͜ͱ͕େ੾ 35 http://www.codem0nk3y.com/2012/04/what-bugs-me-about-modx-and-why/cms-learning-curve/
  36. Custom Content Type -ʮܕʯߏ଄Λ࡞Δ -σʔλΛάϧʔϐϯά͢ΔͨΊ ͷ࿮૊Λ࡞ΔΠϝʔδ -σʔλϕʔεͷʮςʔϒϧʯͷ ఆٛʹ͍ۙ -ʮߏ଄ମʯ΍ʮΫϥεʯͷએݴ ʹ΋͍ۙ

    ΧελϜίϯςϯπλΠϓ 36 അ໊ ໟ৭ ੑผ ੜ೥݄೔ ੜ࢈ऀ അओ ௐڭࢣ ઓ੷ ֫ಘ৆ۚ
  37. ίϯςϯπλΠϓͷྫ 37 ༗അه೦ ౦ژ༏ॣ 1993೥ 1998೥ 12݄26೔ 6݄7೔ 15:20 15:30

    தࢁ ౦ژ ࣳ ࣳ ӈ ࠨ ฏ஍ ฏ஍ 2500 2400 Ϩʔε໊ ։࠵೥ ։࠵݄೔ ൃ૸࣌ࠁ ։࠵৔ അ৔ ํ޲ छผ ڑ཭ ίϯςϯπλΠϓɿϨʔε ίϯςϯπ
  38. Taxonomy -ίϯςϯπʹ෇༩͢Δϥϕϧ -ʮू߹ʯ͓Αͼʮ֊૚ʯߏ଄Λ࡞Δ -λά͸ϘΩϟϒϥϦʔͷҰछɿN:M ʢ֤ίϯςϯπʹରͯ͠બ୒ࢦఆՄʣ -ΧςΰϦ΋ϘΩϟϒϥϦʔͷҰछɿ1:M ʢ֤ίϯςϯπʹରͯ͠୒Ұʣ -ར༻࣌ʹݕࡧ͍ͨ͠ཁૉΛλʔϜͱ͠ ͯఆٛ͢ΔͱΑ͍ λΫιϊϛʔ

    38 λΫιϊϛʔ ϘΩϟϒϥϦʔ B ϘΩϟϒϥϦʔ A ϘΩϟϒϥϦʔ C λʔϜ 1 λʔϜ 2 λʔϜ 3 λʔϜ 4 λʔϜ 5 λʔϜ 6
  39. ʮἙໟʯʁ ʮഅ৔ঢ়ଶʯʁ ʮࠨճΓʯʁ 39

  40. λΫιϊϛʔͷྫ 40 Ϩʔε ίϯσΟγϣϯ അ৔ঢ়ଶ അ৔ ํ޲ ࣳ μʔτ ྑ

    ᜗ॏ ӈ ࠨ അ ඼छ ໟ৭ ੑผ നໟ Ἑໟ αϥ Ξϥϒ Դ ໒
  41. σʔλߏ଄ͷఆٛ͸ σʔλͷʮ࢖͍ํʯʹґଘ͢Δ 41

  42. Views -ʮϑΟϧλʯΛఆٛ͢Δ -DB Server ʹର͢ΔΫΤϦϏϧ μͱͯ͠ಇ͘ -ݕࡧ΍ϦετදࣔΛ؆୯ʹ࣮ݱ Ͱ͖Δ Ϗϡʔζ 42

    APP Server abc 123 Drupal DB Server Views
  43. Block -ϖʔδ্ͷʮҐஔʯΛఆٛ͢Δ -֤ϒϩοΫʹ View ΍ Menu Λ ೖΕΔ͜ͱ΋Ͱ͖Δ -ϨΠΞ΢τมߋ͕༰қͰॊೈ ϒϩοΫ

    43
  44. ઌΛݟ௨ͨ͠σʔλߏ଄Λ࡞Δ೉͠͞ - ౰ॳ͸੩తͩͱࢥͬͯͨσʔλߏ଄͕ಈతʹ มΘΔՄೳੑ - σʔλଐੑͷରԠؔ܎ 1:1 / N:1 /

    1:M / N:M - ྫ֎తͳσʔλͷѻ͍ - σʔλߋ৽ͷཤྺɾมભ͕ཉ͍͠ͱ͖ - ߋ৽ස౓ͷߴ͍σʔλ͸ͦ΋ͦ΋σʔλߏ଄ ͱѻ͍ํΛม͑Δ΂͖ʁ ʢe.g. Φοζʣ 44 Ϩʔε໊ ։࠵೥ ։࠵݄೔ ൃ૸࣌ࠁ ։࠵৔ അ৔ ํ޲ छผ ڑ཭ അ໊ ໟ৭ ੑผ ੜ೥݄೔ ੜ࢈ऀ അओ ௐڭࢣ ઓ੷ ֫ಘ৆ۚ
  45. ߴػೳͰศརͦ͏͚ͩͲ ΍ͬͺΓֶशίετߴͦ͏...😰 45

  46. Ͳ͏ͨ͠ΒֶशίετΛ Լ͛ΒΕΔʁ...🤔 46

  47. ͦ͏ͩ ಉਓࢽɺॻ͜͏ɻ 47

  48. ಉਓࢽΛॻ͍ͨ - ٕज़ॻయ10ͷग़లక੾೔ʢ2020/11/30ʣʹ ࢥཱ͍ͬͯͱΓ͋͑ͣਃ͠ࠐΈ - ࣥචظؒ͸໿3िؒʢ2020/12/1 — 12/24ʣ - ຊΛશ͘ॻ͍ͨ͜ͱͳ͍ϝϯόʔ͹͔Γ

    - ؔ౦ɾ๺ւಓɾѪ஌ͷϝϯόʔ8ਓͰݪߘΛ GitHub্ͰCIճ͠ͳ͕ΒϚʔδͯࣥ͠ච - ͳΜͱ͔క੾DrivenͰॻ্͖͛ͨʂ - ࣥචܦҢͷৄࡉ https://www.acquia.com/jp/blog/published-drupal-ebook-in- techbookfest10 48 Drupal 9 Web։ൃΛ͸͡ΊΔͨΊͷബ͍ຊ
  49. ಉਓࢽͷ໨࣍ - Drupal ͱ͸Կ͔ʁ - Drupal ͷαΠτΛߏஙͯ͠ΈΔ - CentOS 8

    Λ࢖ͬͨ Drupal 9 α Πτ؀ڥߏங - Drupal ΛίϚϯυϥΠϯͰૢ࡞ ͢Δ - Drupalͷߏ੒؅ཧ 49 - αΠτϏϧμʔ෉්߹֨ମݧه - GoogleϩάΠϯΛ࣮ݱ͢Δ - ؅ཧը໘Λ΋ͬͱศརʹʂ Ϟδϡʔϧ3બ - Migrate ೖ໳ - Drupal.org ͷา͖ํ
  50. Ͳ͏ͨ͠Β Drupal Λ ΋ͬͱ஌ͬͯ΋Β͑Δͷ͔ʁ...🤔 50

  51. ಉਓࢽΛॻ͍ͨΒ ঎ۀࢽԽͷ͓࿩͕΍ͬͯདྷͨ 51

  52. "If you want to go fast, go alone. If you

    want to go far, go together." 52 ૣ͘ߦ͖͚ͨΕ͹ɺͻͱΓͰߦ͚ɻ ԕ͘·Ͱߦ͖͚ͨΕ͹ɺΈΜͳͰߦ͚ɻ
  53. ঎ۀࢽΛॻ͍ͨ - ಉਓࢽͷ಺༰Λमਖ਼&Ճච - ίΞͷΞοϓσʔτ - ςʔϚ։ൃ - 2021/4/16 ϦϦʔε

    - ిࢠॻ੶ or ϓϦϯτΦϯσϚϯυ - DrupalΛॳΊͯ৮Δਓ͕ͻͱ·ͣαΠτ Λ࡞ΕΔΑ͏ʹͳΔ·Ͱͷཁૉ͸આ໌͠ ͍ͯΔ...͸ͣ https://nextpublishing.jp/book/12999.html 53 Drupal 9 Web։ൃ͜ͱ͸͡Ί
  54. https://nextpublishing.jp/book/ 12999.html 54 Check it out !

  55. Drupal ͷ༡ͼํ 55

  56. ·ͣ͸ Umami αΠτΛ ৮ͬͯΈΑ͏ʂ 56

  57. Umami - PHP ͷϏϧτΠϯ Web Server ͱ SQLite Ͱ Drupal

    ؀ڥΛϩʔΧϧʹ ߏஙͯ͠ࢼͤΔ - ͋͘·Ͱςετ༻ϓϩϑΝΠϧͳͷ Ͱຊ൪؀ڥʹσϓϩΠ͠ͳ͍Α͏ʹ ஫ҙ - UmamiΛ೔ຊޠԽ͢Δهࣄ https://annai.co.jp/article/drupal8- umami-install-profile-japanese ͏·Έ 57 https://www.drupal.org/docs/installing-drupal/drupal-quick-start-command
  58. ͨͬͨ2ߦ͚ͩͰࢼͤ·͢👍 58 mkdir drupal && cd drupal && curl -sSL

    https://www.drupal.org/ download-latest/tar.gz | tar -xz --strip-components=1 php ./core/scripts/drupal quick-start demo_umami $ $
  59. ʢิ଍ʣPHP Fatal error: Allowed memory size of xxxxxxxxx bytes exhausted

    $ php ./core/scripts/drupal quick-start demo_umami Λ࣮ߦͨ͠ࡍʹ্هΤϥʔ͕දࣔ͞Εͨ৔߹ ʢݪҼʣPHP࣮ߦ༻ʹׂΓ౰ͯΒΕ͍ͯΔϝϞϦ͕গͳ͍ ʢ֬ೝʣ $ php -i | grep memory_limit ʢରԠʣ/etc/php.ini ಺ͷ memory_limit Λ 256M Ҏ্ʹमਖ਼͢Δ 59 memory_limit => 128M => 128M
  60. Umami σϞ 60

  61. ͓͍͍͔͠Ͳ͏͔͸ ͥͻࣗ෼Ͱࢼ৯ͯ͠Έ·͠ΐ͏😋 61

  62. Acquia Certification - Acquia ͕ओ࠵͍ͯ͠Δ Drupal ೝఆࢼݧ - αΠτϏϧμʔ -

    σϕϩούʔ - ϑϩϯτΤϯυεϖγϟϦετ - όοΫΤϯυεϖγϟϦετ - डݧྉ $155 — $350 - https://www.acquia.com/jp/solutions/ customer-success/acquia-certification ΞΫΠΞೝఆࢼݧ 62
  63. αΠτϏϧμʔ෉්߹֨ମݧه 63 ΤϯδχΞ σβΠφʔ Drupalॳ৺ऀͷ෉්͕ ೋਓͦΖͬͯࢼݧʹड͔Δ·Ͱͷ ษڧ๏΍ϙΠϯτΛ·ͱΊͯ·͢ʂ

  64. ࣍ճͷٕज़ॻయ11ʹ޲͚ͯ ଓฤͷ Drupal ಉਓࢽΛӶҙࣥචதʂ💪 64

  65. ݱࡏΦϯϥΠϯͰ։࠵͍ͯ͠Δ Drupal Meetup - ͲΕ΋݄1ճ͙Β͍ͷϖʔεͰ։࠵͍ͯ͠Δ - Drupal Meetup ๛ా https://drupal-meetup-toyota.connpass.com

    - Drupal Meetup Ӌా https://drupal-meetup-haneda.connpass.com - Drupal Meetup Tokyo https://drupal-tokyo.connpass.com 65
  66. 66 © DrupalCamp DEN 2019 NAGOYA

  67. ͥͻ Drupal Meetup / Camp Ͱ ͓ձ͍͠·͠ΐ͏ʂ 67

  68. Thank you ! 68

  69. ࢀߟࢿྉ1 - DrupalެࣜαΠτ https://www.drupal.org - Drupal ࠷৽൛ͷμ΢ϯϩʔυϖʔδ https://www.drupal.org/project/drupal - CMSγΣΞͷσʔλ

    https://w3techs.com/technologies/history_overview/ content_management/ms/y 69
  70. ࢀߟࢿྉ2 - ٕज़ॻయ10ͰDrupalͷബ͍ຊΛൃߦ͠·ͨ͠ https://www.acquia.com/jp/blog/published-drupal-ebook-in- techbookfest10 - ঎ۀࢽʮDrupal 9 Web։ൃ͜ͱ͸͡Ίʯ https://nextpublishing.jp/book/12999.html

    - Drupal Quick Start Command https://www.drupal.org/docs/installing-drupal/drupal-quick-start-command - Drupalೝఆࢼݧ ΞΫΠΞೝఆϓϩάϥϜ https://www.acquia.com/jp/solutions/customer-success/acquia- certification 70