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

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

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

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

Other Decks in Programming

Transcript

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

    ຊ΢ΣϏφʔ͸ɺʮΞΫΠΞೝఆαΠτϏϧμʔ - Drupal 9ʯࢼݧͷग़୊ൣғΛ໢ཏͨ͠ɺ શ7ճͷࢼݧରࡦରࡦߨ࠲Ͱ͢ɻࢼݧ߹֨Λ໨ࢦ͢ํ͸΋ͪΖΜɺDrupalΛମܥతʹֶͼͨ ͍ํʹ΋͓͢͢ΊͰ͢ɻ – DrupalΛҰ௨Γૢ࡞ͨ͜͠ͱ͕͋ΔํΛର৅ͱ͍ͯ͠·͢ɻ·ͩDrupalΛ৮ͬͨ͜ͱ͕ແ ͍ํ͸ɺॳ৺ऀ޲͚DrupalνϡʔτϦΞϧಈըʢ೔ຊޠʣΛઌʹݟ͓ͯ͘ͱΑΓཧղ͕ਂ ·Γ·͢ɻ
  2. ίϯτϦϏϡʔτϞδϡʔϧΛར༻ͯ͠ΈΑ͏ 1. Ϟδϡʔϧͷݕࡧ 2. ϞδϡʔϧͷධՁ 3. Ϟδϡʔϧͷμ΢ϯϩʔυ 4. Ϟδϡʔϧͷ༗ޮԽ 5.

    Ϣʔβʔݖݶͷઃఆ 6. ϞδϡʔϧͷΞϯΠϯετʔϧ 7. ϞδϡʔϧΛίʔυϕʔε͔Β׬શʹ࡟আ͢Δ ίϯτϦϏϡʔτϞδϡʔϧΛ࢖༻͢ΔҰ࿈ͷૢ࡞Λ
 ͝঺հ͠·͢ɻ
  3. ݕࡧͷϑΟϧλϦϯάͱιʔτ ݕࡧ߲໨ ղઆ ྫ Maintenance status Ϟδϡʔϧͷϝϯςφϯεͷස౓͸ʁ Actively maintained Development

    status Ϟδϡʔϧͷ։ൃঢ়گ͸ʁ Any Module categories ϞδϡʔϧͷΧςΰϦ͸ʁ Administration Works with DrupalͷͲͷϝδϟʔόʔδϣϯͰಈ͖ ·͔͢ʁ 9.x Status ϓϩδΣΫτͷεςʔλε͸ʁ Full projects Stability ϓϩδΣΫτͷ҆શੑ͸ʁ Has a supported stable release Security advisory coverage ηΩϡϦςΟΞυόΠβϦΧόϨοδ͸ ͋Δ͔ʁ Has security advisory coverage Search modules ϫʔυݕࡧ Admin Toolbar Sort by ݕࡧ݁Ռͷฒͼସ͑ Most installed
  4. Ϟδϡʔϧͷμ΢ϯϩʔυηΫγϣϯ μ΢ϯϩʔυηΫγϣϯͷ৭෼͚ – άϦʔϯͷ৔߹ – ຊ൪αΠτͰར༻ਪ঑ – ԫ৭ͷ৔߹ – ຊ൪αΠτͰར༻͢Δલʹཁݕূ

    – ੺ͷ৔߹ – ςετͰͷར༻ͷΈਪ঑ όʔδϣϯͷϦϦʔελΠϓ ҆શ >> ϦϦʔεީิ > ϕʔλ > ΞϧϑΝ >> ෆ҆ఆ – ϦϦʔεީิ(RC)ɹx.x.x-rc – ΄΅҆ఆͨ͠ίʔυͱΈͳͯ͠ɺϦϦʔεީิͱͯ͠ݕ౼ – ϕʔλ(Beta)ɹx.x.x-beta – ॏେͳσʔλଛࣦͱηΩϡϦςΟόά͕ղܾ – ΞϧϑΝ(Alpha)ɹx.x.x-alpha – ҆ఆੑ͕࠷΋௿͍ɻใࠂ͞ΕͨΤϥʔͷ΄ͱΜͲ͸ղܾ͞Εͯ ͍·͕͢ɺηΩϡϦςΟͷ໰୊ͳͲɺະղܾͷط஌ͷ໰୊͕· ͩଘࡏ͢ΔՄೳੑ͕͋Γ·͢ɻ ηΩϡϦςΟΞυόΠβϦʔ
 ͷର৅ϦϦʔε
  5. 2. ϞδϡʔϧͷධՁ 1. ධ൑ – ϝϯςφ͸Կਓʁϝϯςφ͸ଞʹͲͷΑ͏ͳߩݙΛ͍ͯ͠Δʁ – ݸਓʁͦΕͱ΋اۀ͸Drupal Associationͷϝϯόʔʁ 2.

    Ϧʔν – ϞδϡʔϧͷपΓʹίϛϡχςΟ͸͋Δ͔ʁ – ͦΕͱ౷߹͢Δؔ࿈Ϟδϡʔϧ͸͋Δ͔ʁμ΢ϯϩʔυͷ૯਺͸͍ͭ͘ʁ – ࢖༻ྔͷਪҠΛݟͯɺ҆ఆͨ͠ހΛඳ͍͍ͯΔ͔ʁ 3. ྲྀ௨ – ࠷ۙͷίϛοτ͸͔͋ͬͨʁϢʔβʔʹΑͬͯissue͕௥Ճ͞Ε͍ͯΔ͔ʁ – ϝϯςφ͸Ԡ౴͍ͯ͠Δ͔ʁ҆ఆͨ͠ʢάϦʔϯ/ΞϧϑΝ·ͨ͸ϕʔλͰ͸ͳ͍ʣϦϦʔε͸͋ Γ·͔͢ʁ ϞδϡʔϧΛධՁ͢ΔͨΊͷ3ͭͷϙΠϯτ https://dev.acquia.com/blog/how-select-drupal-modules-part-3-evaluation-tips
  6. ComposerͰߦ͏Ϟδϡʔϧͷμ΢ϯϩʔυ 1. ϞδϡʔϧͷϓϩδΣΫτϖʔδͷ
 όʔδϣϯ൪߸ΛΫϦοΫ 2. ComposerͰμ΢ϯϩʔυ͢Δ৔߹ͷίϚϯυྫΛ֬ೝ
 
 
 
 3.

    DrupalͷϓϩδΣΫτϧʔτʹҠಈ͠ɺ࣍ͷίϚϯυΛ࣮ߦ
 $ composer require 'drupal/admin_toolbar:^3.0' ʢ༨ஊʣLando؀ڥͰ͸ίϚϯυͷ಄ʹ lando Λ͚ͭͯɺ࣍ͷίϚϯυͰ΋࣮ߦͰ͖·͢Αʂ
 $ lando composer require 'drupal/admin_toolbar:^3.0' ʮAdmin ToolbarʯϞδϡʔϧΛྫʹࢼͯ͠Έ·͢ɻ ※DrupalϓϩδΣΫτϧʔτʹcomposer.json͕ଘࡏ͢Δ͜ͱ͕લఏ
 ˞composerίϚϯυ͕࢖༻Ͱ͖Δ͜ͱ͕લఏ
  7. 4. ϞδϡʔϧΛ༗ޮԽ͢Δ 1. Drupalͷ؅ཧը໘͔Βߦ͏ 2. DrushͰߦ͏ ←ͬͪ͜Ͱઆ໌ ؅ཧը໘͔Βߦ͏ํ๏΋͋Γ·͕͢ɺ
 ࠓճ͸DrushίϚϯυͰߦ͏ํ๏Λ঺հ͠·͢ɻ 1.

    ༗ޮԽ͍ͨ͠ϞδϡʔϧͷʮϚγϯ໊ʯΛ֬ೝ
 Ϛγϯ໊͸ϓϩδΣΫτϖʔδͷURL͔Β൑ผͰ͖·͢
 https://www.drupal.org/project/admin_toolbar 2. DrupalͷϓϩδΣΫτϧʔτʹҠಈ͠ɺ࣍ͷίϚϯυΛ࣮ߦ
 $ vendor/bin/drush pm:enable admin_toolbar ʢ༨ஊʣLando؀ڥͰ͸࣍ͷίϚϯυͰ΋࣮ߦͰ͖·͢Αʂ
 $ lando drush pm:enable admin_toolbar DrushίϚϯυͰߦ͏Ϟδϡʔϧͷ༗ޮԽ ઌ΄Ͳμ΢ϯϩʔυͨ͠ʮAdmin ToolbarʯϞδϡʔϧΛ༗ޮԽ͠·͢ɻ ※DrushίϚϯυ͕࢖༻Ͱ͖Δ͜ͱ͕લఏ
  8. 6. ϞδϡʔϧͷΞϯΠϯετʔϧ 1. Drupalͷ؅ཧը໘͔Βߦ͏ 2. DrushͰߦ͏ ←ͬͪ͜Ͱઆ໌ ؅ཧը໘͔Βߦ͏ํ๏΋͋Γ·͕͢ɺ
 ࠓճ͸DrushίϚϯυͰߦ͏ํ๏Λ঺հ͠·͢ɻ 1.

    ༗ޮԽ͍ͨ͠ϞδϡʔϧͷʮϚγϯ໊ʯΛ֬ೝ
 Ϛγϯ໊͸ϓϩδΣΫτϖʔδͷURL͔Β൑ผͰ͖·͢
 https://www.drupal.org/project/admin_toolbar 2. DrupalͷϓϩδΣΫτϧʔτʹҠಈ͠ɺ࣍ͷίϚϯυΛ࣮ߦ
 $ vendor/bin/drush pm:uninstall admin_toolbar ʢ༨ஊʣLando؀ڥͰ͸࣍ͷίϚϯυͰ΋࣮ߦͰ͖·͢Αʂ
 $ lando drush pm:uninstall admin_toolbar DrushίϚϯυͰߦ͏ϞδϡʔϧͷΞϯΠϯετʔϧ ઌ΄Ͳ༗ޮԽͨ͠ʮAdmin ToolbarʯϞδϡʔϧΛΞϯΠϯετʔϧ͠·͢ɻ ※DrushίϚϯυ͕࢖༻Ͱ͖Δ͜ͱ͕લఏ
  9. 7. ϞδϡʔϧΛίʔυϕʔε͔Β׬શʹ࡟আ͢Δ ϞδϡʔϧΛΞϯΠϯετʔϧ͚ͨͩ͠Ͱ͸ɺ·ͩίʔυϕʔεʹϞδϡʔ ϧͷϑΝΠϧ܈͕࢒͍ͬͯΔঢ়ଶͰ͢ɻ ComposerͰϞδϡʔϧΛ؅ཧ͍ͯ͠Δ৔߹͸ɺ $ composer remove drupal/ϞδϡʔϧϚγϯ໊ Ͱ࡟আ͕ՄೳͰ͢ɻ

    ׬શʹ࢖Θͳ͘ͳͬͨίϯτϦϏϡʔτϞδϡʔϧ͸ίʔυϕʔε͔Β΋ ࡟আ͓͖ͯ͠·͠ΐ͏ɻ ※ίΞϞδϡʔϧʹؔͯ͠͸͜ͷૢ࡞͸ߦ͍·ͤΜɻ 
 ίϯτϦϏϡʔτϞδϡʔϧ͸
 ίʔυϕʔεͷͲ͜ʹ഑ஔ͞ΕΔʁ • Ұൠతʹɺ΢Σϒϧʔτ௚ԼͷmodulesσΟϨ ΫτϦʹɺίϯτϦϏϡʔτϞδϡʔϧͱΧε λϜϞδϡʔϧ͕ࠞಉ͠ͳ͍Α͏ʹσΟϨΫτ ϦΛ෼͚ͯ഑ஔ͞Ε·͢ɻ
 
 web
 ᵋᴷ modules
 ᵓᴷ contrib
 ᴹ ᵋᴷ admin_toolbar
 ᵋᴷ custom
 • ComposerͰϞδϡʔϧΛ؅ཧ͍ͯ͠Δ৔߹͸ɺ composer.json Ͱఆٛ͞Εͨ΋ͷ͕ద༻͞Ε· ͢ɻ
 ίϯτϦϏϡʔτϞδϡʔϧ ΧελϜϞδϡʔϧ
  10. ݕࡧͷϑΟϧλϦϯάͱιʔτ ݕࡧ߲໨ ղઆ ྫ Maintenance status ςʔϚͷϝϯςφϯεͷස౓͸ʁ Actively maintained Development

    status ςʔϚͷ։ൃঢ়گ͸ʁ Any Works with DrupalͷͲͷϝδϟʔόʔδϣϯͰಈ͖ ·͔͢ʁ 9.x Status ϓϩδΣΫτͷεςʔλε͸ʁ Full projects Stability ϓϩδΣΫτͷ҆શੑ͸ʁ Has a supported stable release Security advisory coverage ηΩϡϦςΟΞυόΠβϦΧόϨοδ͸ ͋Δ͔ʁ Has security advisory coverage Search themes ϫʔυݕࡧ Sort by ݕࡧ݁Ռͷฒͼସ͑ Most installed ʢΧςΰϦ͕ແ͍͚ͩͰʣ
 Ϟδϡʔϧͱ΄ͱΜͲಉ͡ʂ
  11. 2. ςʔϚΛμ΢ϯϩʔυ͢Δ Ϟδϡʔϧͱಉ༷ͷखॱͰߦ͍·͢ɻʮBarrioʯςʔϚΛྫʹࢼͯ͠Έ·͢ɻ 1. ϞδϡʔϧͷϓϩδΣΫτϖʔδͷ
 όʔδϣϯ൪߸ΛΫϦοΫ 2. ComposerͰμ΢ϯϩʔυ͢Δ৔߹ͷίϚϯυྫΛ֬ೝ
 
 


    
 3. DrupalͷϓϩδΣΫτϧʔτʹҠಈ͠ɺ࣍ͷίϚϯυΛ࣮ߦ
 $ composer require 'drupal/bootstrap_barrio:^5.1' ʢ༨ஊʣLando؀ڥͰ͸࣍ͷίϚϯυΛ࣮ߦ
 $ lando composer require 'drupal/admin_toolbar:^3.0'
  12. 3. ςʔϚΛ༗ޮԽ͢Δ 1. ༗ޮԽ͍ͨ͠ςʔϚͷʮϚγϯ໊ʯΛ֬ೝ
 Ϛγϯ໊͸ϓϩδΣΫτϖʔδͷURL͔Β൑ผͰ͖·͢
 https://www.drupal.org/project/bootstrap_barrio 2. DrupalͷϓϩδΣΫτϧʔτʹҠಈ͠ɺ࣍ͷίϚϯυΛ࣮ߦ
 $ vendor/bin/drush

    theme:enable bootstrap_barrio ʢ༨ஊʣLando؀ڥͰ͸࣍ͷίϚϯυΛ࣮ߦ
 $ lando drush theme:enable bootstrap_barrio Ϟδϡʔϧͱʢ΄΅ʣಉ༷ͷखॱͰߦ͍·͢ɻ
 ઌ΄Ͳμ΢ϯϩʔυͨ͠ʮBarrioʯςʔϚΛ༗ޮԽ͠·͢ɻ
  13. ίϛϡχςΟͷߩݙํ๏ ίϯτϦϏϡʔτ͸ඞͣ͠΋ίʔυΛॻ͚ͩ͘Ͱ͸͋Γ·ͤΜɻ
 DrupalϓϩδΣΫτʹ͸ɺվળʹߩݙͰ͖Δଟ͘ͷྖҬ͕͋Γ·͢ɻ – DrupalͷΞΫηγϏϦςΟ޲্ʹߩݙ͢Δ – ίϯτϦϏϡʔτϞδϡʔϧɺ
 ςʔϚɺσΟετϦϏϡʔγϣϯʹߩݙ͢ Δ –

    ίϯτϦϏϡʔλʔΨΠυʹ౤ߘ͢Δ – υΩϡϝϯτʹߩݙ͢Δ – DrupalίΞʹߩݙ͢Δ – Drupal.org ͷWebαΠτʹߩݙ͢Δ – ΠϕϯτΛاը͢Δ – ஌ࣝڞ༗Ͱߩݙ͢Δ – DrupalͷϚʔέςΟϯάࢿྉʹߩݙ͢Δ – ϝϯλϦϯάʹΑΔߩݙ – αϙʔτΛఏڙ͢Δ – ຋༁ʹߩݙ͢Δ – DrupalͷϢʔβʔϏϦςΟʹߩݙ͢Δ ߩݙ෼໺ͷϦετ https://www.drupal.org/community/contributor-guide/contribution-areas
  14. ιϑτ΢ΣΞ·ͨ͸υΩϡϝϯτͷόάใࠂ Drupalιϑτ΢ΣΞ΍υΩϡϝϯτʹ໰୊Λൃݟͨ͠৔߹ɺใࠂ͢Δ͜ͱͰɺDrupalίϛϡχςΟʹͱͬͯେ͖ͳ རӹͱͳΓɺमਖ਼΍ରॲ͕ՄೳͱͳΓ·͢ɻ – ηΩϡϦςΟʹؔ͢ΔIssue͸ɺ੬ऑੑ͕ެ։͞ΕΔલʹमਖ਼͞ΕΔΑ͏ʹɺݸผͷػີͷ໰୊ΩϡʔͰॲཧ͞Ε· ͢ɻ – drupal.orgͷυΩϡϝϯτ͸ɺ௥Ճɺमਖ਼͸υΩϡϝϯτΛ௚઀ฤूͰ͖·͢ɻ – api.drupal.orgͷυΩϡϝϯτ͸ɺίʔυ಺ͷίϝϯτ͔Βੜ੒͞ΕΔͨΊɺιϑτ΢ΣΞͷIssueൃߦͱಉ͡ํ๏͕

    ࠾༻͞Ε·͢ɻ – ιϑτ΢ΣΞʹؔ͢ΔIssue͸ɺର৅ͷϓϩδΣΫτϖʔδ͔Β࡞੒͠·͢ɻ
 IssueΛ࡞੒͢Δલʹɺಉ͡Α͏ͳIssue͕طʹใࠂ͞Εͯͳ͍͔֬ೝ͢Δඞཁ͕͋Γ·͢ɻ – drupal.orgͷWebαΠτ͸ɺͪ͜Βͷ ϔϧϓϖʔδ Λࢀর – ຋༁͸ɺlocalize.drupa.org ͷ֤ݴޠͷνʔϜ·Ͱ IssueΛใࠂ͢Δ৔ॴ https://www.drupal.org/community/#report-issue
  15. IssueͷΤνέοτ ͢΂ͯͷίϛϡχςΟʹ͸ߦಈنൣ͕͋Γ·͢ʂIssueΛ࡞੒͢Δࡍʹ͜ΕΒͷΨΠυϥΠϯʹै͏ͱɺϓϩδΣΫτϝϯςφʔ ͔Βਝ଎Ͱద੾ͳࢧԉΛड͚ΔͰ͠ΐ͏ɻ·ͨɺ͋ͳ͕ͨDrupalίϛϡχςΟͷՁ஋͋Δϝϯόʔͱͯ͠ೝࣝ͞ΕΔͰ͠ΐ͏ɻ – ਖ਼͍͠৔ॴͰIssueΛใࠂ͢Δ – IssueΛ࡞੒͢Δલʹɺࣗ෼ͰղܾͰ͖Δ͔ࢼͯ͠ΈΔ – IssueΛ࡞੒͢Δલʹɺؔ࿈͢ΔυΩϡϝϯτΛಡΉ –

    ࠷৽ͷ։ൃόʔδϣϯΛμ΢ϯϩʔυͯ͠ɺ໰୊͕͢Ͱʹमਖ਼͞Ε ͍ͯΔ͔Ͳ͏͔Λ֬ೝ͢Δ – Issue QueueͰɺൃੜ͍ͯ͠Δ໰୊ͱྨࣅͷ໰୊Λݕࡧ͢Δ – ಉ༷ͷIssueΛݟ͚ͭͨ৔߹͸ɺ໰୊͕ຊ౰ʹಉ͡Ͱ͋Δ͔ɺ৽͍͠ IssueΛ࡞੒͢Δඞཁ͕͋Δ͔Λݕ౼ – Issue SummaryςϯϓϨʔτΛ࢖༻ͯ͠આ໌Λఏڙ͢Δ 👍 ΍Δ΂͖͜ͱʢൈਮʣ 🚫 ΍Δ΂͖Ͱͳ͍͜ͱʢൈਮʣ – ηΩϡϦςΟؔ࿈ͷIssueΛϓϩδΣΫτͷIssueͰ࡞੒͠ͳ͍Ͱ ͍ͩ͘͞ɻηΩϡϦςΟIssueͷ࡞੒ํ๏͸security.drupal.orgͰ ใࠂ͢Δඞཁ͕͋Γ·͢ɻ – ʮxyzϞδϡʔϧ͕ػೳ͠ͳ͍ʯ͚ͩͷઆ໌Ͱ͸଍Γ·ͤΜɻઆ ໌͸ৄࡉʹɻ – ѱ͍λΠτϧͷྫɿ
 SITE BROKEN YOU MUST FIX NOW!!!111!! – Կ͔͕ࢥͬͨ௨Γʹಈ͔ͳ͍ͱඇৗʹΠϥΠϥ͢Δ΋ͷͰ͢ ͕ɺ։ൃऀ΍Issue Queueʹീͭ౰ͨΓͯ͠͸͍͚·ͤΜɻ https://www.drupal.org/docs/develop/issues/issue-procedures-and- etiquette/issue-etiquette