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

アクイア認定サイトビルダー試験対策講座 第5回 サイトの構成 / Prep for exam ...

アクイア認定サイトビルダー試験対策講座 第5回 サイトの構成 / Prep for exam Site Builder vol.5

More Decks by アクイアジャパン Acquia Japan

Other Decks in Programming

Transcript

  1. ΞΫΠΞೝఆαΠτϏϧμʔ ࢼݧରࡦߨ࠲γϦʔζ – ʮΞΫΠΞೝఆαΠτϏϧμʔ - Drupal 9ʯࢼݧ͸ɺίΞϞδϡʔϧ͓Αͼ֦ுϞδϡʔϧ Λ࢖༻ͯ͠DrupalαΠτΛߏங͢ΔϓϩϑΣογϣφϧ޲͚ͷࢿ֨Ͱ͢ɻ͜ͷࢼݧ͸ɺ DrupalαΠτϏϧμʔͷεΩϧɺ஌ࣝͷݕূΛ໨తͱͯ͠σβΠϯ͞Ε͍ͯ·͢ɻ –

    ຊ΢ΣϏφʔ͸ɺʮΞΫΠΞೝఆαΠτϏϧμʔ - Drupal 9ʯࢼݧͷग़୊ൣғΛ໢ཏͨ͠ɺ શ7ճͷࢼݧରࡦରࡦߨ࠲Ͱ͢ɻࢼݧ߹֨Λ໨ࢦ͢ํ͸΋ͪΖΜɺDrupalΛମܥతʹֶͼͨ ͍ํʹ΋͓͢͢ΊͰ͢ɻ – DrupalΛҰ௨Γૢ࡞ͨ͜͠ͱ͕͋ΔํΛର৅ͱ͍ͯ͠·͢ɻ·ͩDrupalΛ৮ͬͨ͜ͱ͕ແ ͍ํ͸ɺॳ৺ऀ޲͚DrupalνϡʔτϦΞϧಈըʢ೔ຊޠʣΛઌʹݟ͓ͯ͘ͱΑΓཧղ͕ਂ ·Γ·͢ɻ
  2. 1. ΞΧ΢ϯτͷઃఆ ΞΧ΢ϯτઃఆϖʔδͰͰ͖Δ͜ͱ – ಗ໊Ϣʔβʔͷ໊শͷมߋ – Ϣʔβʔࣗ਎͕ΞΧ΢ϯτΛొ࿥Ͱ͖ΔΑ͏ʹ͢Δ/͠ͳ͍ – ΞΧ΢ϯτ௨஌ϝʔϧͷʮࠩग़ਓʯϝʔϧΞυϨεͷઃఆ –

    DrupalαΠτͰߦΘΕΔ௨஌ϝʔϧͷຊจͷΧελϚΠζ – ΧελϜϑΟʔϧυͷ௥Ճ – ϑΥʔϜͷදࣔ؅ཧઃఆ – දࣔ؅ཧઃఆ – ຋༁
  3. 3. ը૾ελΠϧ DrupalʹΞοϓϩʔυͨ͠ը૾ʹ • άϨʔεέʔϧԽ • εέʔϧ • τϦϛϯά •

    ϦαΠζ • ճస • ม׵ • ֦ுͱτϦϛϯά ΤϑΣΫτΛ௥Ճ͢Δͱɾɾ ͍ΖΜͳݟͤํ͕Ͱ͖Δʂ ਖ਼ํܗ άϨʔ
 εέʔϧ ίϯςϯπͷ දࣔ؅ཧͳͲͰ ը૾ϑΟʔϧυʹରͯ͠ ը૾ελΠϧΛ
 ࢖༻Ͱ͖Δ ୯Ұͷը૾͔Βෳ਺ͷը૾ͱͯ͠දݱͰ͖Δ ॎԣൺݻఆͰ
 αΠζมߋ
  4. Drupalͷσʔλͷछྨ DrupalαΠτͰѻΘΕΔσʔλ͸4छྨʹ෼ྨ – Content – αΠτ๚໰ऀʹදࣔ͢Δ͜ͱΛ໨తͱͨ͠ςΩετɺը૾ͳ Ͳͷ৘ใ – Configuration –

    αΠτͷಈ࡞ɺදࣔํ๏ͳͲΛఆٛ͢Δ৘ใ – ௨ৗ͸খ͞ͳςΩετͰදݱ͞ΕΔ܏޲ – State – cronδϣϒ͕࠷ޙʹ࣮ߦ͞Εͨ࣌ࠁͳͲɺ
 αΠτͷݱࡏͷঢ়ଶʹؔ͢ΔҰ࣌తͳੑ࣭ͷ৘ใ – Session – ϩάΠϯ͍ͯ͠Δ͔Ͳ͏͔΍CookieͳͲɺݸʑͷαΠτ๚໰ ऀͷαΠτͱͷ΍ΓऔΓʹؔ͢Δ৘ใ https://www.drupal.org/docs/user_guide/en/understanding-data.html
  5. Drupalͷσʔλͷछྨ DrupalαΠτͰѻΘΕΔσʔλ͸4छྨʹ෼ྨ – Content – αΠτ๚໰ऀʹදࣔ͢Δ͜ͱΛ໨తͱͨ͠ςΩετɺը૾ͳ Ͳͷ৘ใ – Configuration –

    αΠτͷಈ࡞ɺදࣔํ๏ͳͲΛఆٛ͢Δ৘ใ – ௨ৗ͸খ͞ͳςΩετͰදݱ͞ΕΔ܏޲ – State – cronδϣϒ͕࠷ޙʹ࣮ߦ͞Εͨ࣌ࠁͳͲɺ
 αΠτͷݱࡏͷঢ়ଶʹؔ͢ΔҰ࣌తͳੑ࣭ͷ৘ใ – Session – ϩάΠϯ͍ͯ͠Δ͔Ͳ͏͔΍CookieͳͲɺݸʑͷαΠτ๚໰ ऀͷαΠτͱͷ΍ΓऔΓʹؔ͢Δ৘ใ https://www.drupal.org/docs/user_guide/en/understanding-data.html Configuration͸YAMLܗࣜͰ
 ΤΫεϙʔτɾΠϯϙʔτͰ͖Δ ͭ·Γ...αΠτͷઃఆΛίʔυϕʔεͰ؅ཧՄೳ ͭ·Γ...όʔδϣϯ؅ཧͱࠩ෼ൺֱ͕Ͱ͖Δ
  6. Configuration Managementʢߏ੒؅ཧʣͱ͸ uuid: 302fbf40-a72a-4943-be1f-5fad8fc5c0cc name: 'λϐΦΧ٤஡ళ ·Δ஡' mail: [email protected] slogan:

    '' page: 403: '' 404: '' front: /node admin_compact_mode: false weight_select_max: 100 langcode: ja system.site.yml – Drupalͷߏ੒ΛYAMLܗࣜͰΤΫεϙʔτɾΠϯϙʔτग़དྷΔػೳ – هࣄͷλΠτϧ΍ຊจͳͲͷαΠτͷίϯςϯπ͸ߏ੒؅ཧʹؚ·Εͳ͍
  7. ߏ੒؅ཧΛ࢖͍࢝ΊΔ 1. ؔ࿈Ϟδϡʔϧͷ༗ޮԽ – ߏ੒؅ཧΛ࢖༻͢Δʹ͸࣍ͷϞδϡʔϧΛ༗ޮԽ͢Δ – configuration manager
 2. ߏ੒ϑΝΠϧΛ഑ஔ͢ΔσΟϨΫτϦͷ࡞੒

    – ϓϩδΣΫτϧʔτ௚Լʹ config/default σΟϨΫτϦΛ࡞੒ – σΟϨΫτϦ໊͸ͳΜͰ΋OK
 3. σΟϨΫτϦΛDrupalଆʹೝࣝͤ͞ΔઃఆΛ௥Ճ – settings.phpʹ 
 $settings['config_sync_directory'] = '../config/default'; Λ௥Ճ 1. ʢΦϓγϣϯʣDrushΛಋೖ͢Δ – Lando؀ڥͷ৔߹ɺ
 $ lando composer require drush/drush ͰΠϯετʔϧ – $ lando drush --version ͰίϚϯυΛݺͼग़͢ 
 ಉظσΟϨΫτϦ͸Ͳ͜ʹ഑ஔ͢Δ΂͖ʁ • ΢Σϒ͔ΒΞΫηεͰ͖ͳ͍Α͏ʹ
 υΩϡϝϯτϧʔτͷ֎ʹ഑ஔ͢Δ͜ͱ͕ଟ ͍ • υΩϡϝϯτϧʔτҎԼʹ഑ஔ͢Δ৔߹͸ σΟϨΫτϦ໊ʹϋογϡ஋ͳͲΛར༻ͯ͠ ਪଌ͞Εͳ͍Α͏ʹ͢Δɺ΋͘͠͸ΞΫηε Ͱ͖ͳ͍Α͏ʹapacheͳͲͰઃఆ͢Δ

  8. ߏ੒؅ཧͷओͳૢ࡞ – DrupalαΠτͷߏ੒ΛYAMLϑΝΠϧͱͯ͠ΤΫεϙʔτ͢Δ – $ drush config:export
 – YAMLϑΝΠϧ͔Βߏ੒ΛDrupalαΠτʹΠϯϙʔτ͢Δ –

    $ drush config:import
 – YAMLϑΝΠϧͱσʔλϕʔεͷɺߏ੒ઃఆͷࠩ෼֬ೝ – $ drush config:status
 – ߏ੒ઃఆΛίϚϯυϥΠϯ͔Β௚઀ઃఆ͢Δ – $ drush config:set system.site name 'λϐΦΧ٤஡ళ ·Δ஡'
 ؅ཧը໘͔Β΋ૢ࡞͸ߦ͑·͕͢ɺ͜͜Ͱ͸DrushίϚϯυͰͷૢ࡞Λ͝঺հ YAML ϑΝΠϧ ίʔυϕʔε σʔλϕʔ ε Πϯϙʔτ ΤΫεϙʔτ DrupalαΠτ
  9. ࿅श໰୊1 ߏ੒؅ཧʹ͓͍ͯΠϯϙʔτɾΤΫεϙʔτ͕ߦΘΕΔσΟϨΫτϦʹ͍ͭͯɺਖ਼͍͠΋ͷΛબ୒͍ͯͩ͘͠͞ɻ
 1. settings.php ϑΝΠϧͷ $config_directories['sync'] ͷ஋ͰσΟϨΫτϦͷ৔ॴΛఆٛ͢Δɻ 2. σΟϨΫτϦ͸υΩϡϝϯτϧʔτ಺ͷ sites/default

    σΟϨΫτϦ಺Ͱ͋Ε͹೚ҙͷ໊લɺ৔ॴΛࢦఆ͢Δ ͜ͱ͕ՄೳͰ͋Δɻ 3. σΟϨΫτϦ͸ɺ΢Σϒ͔Β௚઀ΞΫηεͰ͖ͳ͍Α͏ʹ .htaccess ϑΝΠϧͳͲͰ੍ޚ͢Δ͜ͱ͕Ͱ͖Δɻ 4. σΟϨΫτϦ͸ .gitignore ϑΝΠϧʹ௥Ճ͢Δͷ͕ϕετϓϥΫςΟεͰ͋Δɻ
  10. ࿅श໰୊1 ߏ੒؅ཧʹ͓͍ͯΠϯϙʔτɾΤΫεϙʔτ͕ߦΘΕΔσΟϨΫτϦʹ͍ͭͯɺਖ਼͍͠΋ͷΛબ୒͍ͯͩ͘͠͞ɻ
 1. settings.php ϑΝΠϧͷ $config_directories['sync'] ͷ஋ͰσΟϨΫτϦͷ৔ॴΛఆٛ͢Δɻ 2. σΟϨΫτϦ͸υΩϡϝϯτϧʔτ಺ͷ sites/default

    σΟϨΫτϦ಺Ͱ͋Ε͹೚ҙͷ໊લɺ৔ॴΛࢦఆ͢Δ ͜ͱ͕ՄೳͰ͋Δɻ 3. σΟϨΫτϦ͸ɺ΢Σϒ͔Β௚઀ΞΫηεͰ͖ͳ͍Α͏ʹ .htaccess ϑΝΠϧͳͲͰ੍ޚ͢Δ͜ͱ͕Ͱ͖Δɻ 4. σΟϨΫτϦ͸ .gitignore ϑΝΠϧʹ௥Ճ͢Δͷ͕ϕετϓϥΫςΟεͰ͋Δɻ ਖ਼ղɿ3