Slide 1

Slide 1 text

MMNBUTVSJ!ZBOEP Modern PHP Tutorial d1)1࣌୅ͷ஌ࣝΛࣺͯɺ1)1࣌୅΁d

Slide 2

Slide 2 text

ZBOEP $BOEZ$BOFQIQ ʮ࠙਌ձϐβൃ஫ΞϓϦʯ

Slide 3

Slide 3 text

1)1ରԠ1BB4 $IFGͰ"84Λࣗಈߏஙɺߋ৽ "84ͱಉ͡؀ڥΛ௿ίετʹ ࣌ؒ༗ਓ؂ࢹΦϓγϣϯ 44)TVEPՄೳ͔ͭαϙʔτ༗

Slide 4

Slide 4 text

1)1 8FCʹಛԽͨ͠εΫϦϓτݴޠ 8FCαʔϏεΛத৺ʹ෯޿͍ར༻ ඇΤϯδχΞͷར༻ऀ΋ଟ͍ ؒҧͬͨϓϥΫςΟε΋޿·͍ͬͯΔ

Slide 5

Slide 5 text

ΞδΣϯμ جૅ஌ࣝ ؒҧͬͨϓϥΫςΟε ϞμϯͳϓϥΫςΟε ΍ͬͯΈΑ͏

Slide 6

Slide 6 text

جૅ஌ࣝ

Slide 7

Slide 7 text

৘ใͷ୳͠ํ ॳ৺ऀ޲͚ͷॻ੶͸๛෋ ެࣜϚχϡΞϧͷಡΈํ͕େࣄ தʙ্ڃऀ޲͚ϑϨʔϜϫʔΫ͸༷ʑ 1)15IF3JHIU8BZ

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

ॻ੶બͼ ಺༰͕ݹ͘ͳΔ ݱ৔ʹ͍ΔஶऀɺϥΠλʔઐ໳ͷஶऀ αϯϓϧίʔυͷηΩϡϦςΟ໰୊ ݁ہ͸Կ࡭͔ͷ߹ΘٕͤʹͳΔ

Slide 10

Slide 10 text

QIQOFU

Slide 11

Slide 11 text

QIQOFU ެࣜϚχϡΞϧ ෆஅͷ౒ྗͰ೔ຊޠԽ͞Ε͍ͯΔ جຊతʹ࠷৽ͷ1)1ʹ४ڌ KQQIQOFUͱ͍͏ϛϥʔ΋͋Δ Կނ͔ σβΠϯ͕ϦχϡʔΞϧ༧ఆ

Slide 12

Slide 12 text

৽σβΠϯ

Slide 13

Slide 13 text

ҠߦΨΠυ

Slide 14

Slide 14 text

ऴྃͨ͠όʔδϣϯ 1)1 ʹऴྃࡁΈ 1)1 ʹऴྃࡁΈ 1)1 ʹऴྃࡁΈ 1)1 ʹऴྃࡁΈ 1)1 ʹऴྃ༧ఆ

Slide 15

Slide 15 text

ݱߦόʔδϣϯ 1)1 ໊લۭؒ Ϋϩʔδϟ ஗Ԇ੩తଋറ -4# 1)1 "SSBZ4IPSU4ZOUBY USBJU ϏϧτΠϯαʔό 1)1 δΣωϨʔλ pOBMMZ

Slide 16

Slide 16 text

ϙΠϯτ 1)1Ҏ߱͸͔ͭͯ͸1)1ͱݺ͹Εͯ ͍ͨػೳΛؚΜͰ͍Δ 1)1த৺ͷݱ৔Ͱ͋ͬͯ΋1)1Ҏ߱ ͷػೳͷ׆༻͸े෼ʹਐΜͰ͍ͳ͍

Slide 17

Slide 17 text

Ϟμϯ1)1 ݹ͍ϓϥΫςΟεΛഇ͠ɺ ਖ਼͍͠1)1Λॻ͜͏

Slide 18

Slide 18 text

ϨΨγʔ1)1ɺɹۦஞͯ͠΍Δʜ ͜ͷੈ͔ΒʜɹҰߦʜ࢒Βͣ

Slide 19

Slide 19 text

ؒҧͬͨϓϥΫςΟε photo by toyohara

Slide 20

Slide 20 text

਺ʑͷؒҧ͍ JOD $3-' SFHJTUFS@HMPCBMT TBGF@NPEF NBHJD@RVPUF ! WBS NZTRM@DPOOFDU SFRVJSF@PODF 1&"3 ؆୯ Nڃ ΍΍ෳࡶ Nڃ ΍΍ෳࡶ Nڃ ෳࡶ Nڃ

Slide 21

Slide 21 text

ϑΝΠϧ JOD $3-'

Slide 22

Slide 22 text

ϑΝΠϧͷ࠷ޙͷ ͸লུͰ͖Δ ͷޙͷۭന͕΍͔͍ͬ )551ϔομͷ੍ޚෆೳɺṖͷۭߦ େྔͷϑΝΠϧʹฆΕΔͱ໽հ

Slide 23

Slide 23 text

Ṗͷۭߦ render(); ?>

Slide 24

Slide 24 text

͜ͷԿॲ͔ʹۭߦ͕ʜ

Slide 25

Slide 25 text

͜ΕͰΑ͍ render(); QIQͷ಺෦ͷۭߦ͸ग़ྗ͞Εͳ͍

Slide 26

Slide 26 text

JOD$3-' ֦ுࢠJODͷϑΝΠϧʹϥΠϒϥϦΛ ஔ͘ѱश ίʔυ࿙Ӯͷةݥ͋Γ վߦίʔυ΋-'ʹ౷Ұ͢΂͖

Slide 27

Slide 27 text

1)1ͷҨ࢈ SFHJTUFS@HMPCBMT TBGF@NPEF NBHJD@RVPUF@HQD SVOUJNF ഇࢭ͞ΕΔͷͰೋ౓ͱ࢖ͬͯ͸͍͚ͳ͍

Slide 28

Slide 28 text

ෆ׬શͳ001ͷ໊࢒ ! WBS

Slide 29

Slide 29 text

! Τϥʔ཈੍ԋࢉࢠ ͔ͭͯ͸ྫ֎͕ଘࡏ͠ͳ͔ͬͨ σόοάΛࠔ೉ʹ͢Δ໽հͳଘࡏ ద੾ʹίʔσΟϯά͢Ε͹ແ༻ͷଘࡏ

Slide 30

Slide 30 text

WBS QVCMJDQSJWBUFͳͲ͕ແ͔ͬͨࠒͷଘࡏ QVCMJDQSJWBUFΛهड़͢Δ΂͖ TUBUJD΋ద੾ʹઃఆ͢Δ

Slide 31

Slide 31 text

໌ࣔతͳࢀর౉͠ ͔ͭͯ͸ϝϞϦઅ໿ͷςΫχοΫ ݱࡏ͸ৗʹࢀরʹͳΔͷͰෆཁ ͋͑ͯίϐʔ͍ͨ࣌͠ʹDMPOF

Slide 32

Slide 32 text

1)1 foo = 2; echo $obj->foo;

Slide 33

Slide 33 text

͸ෆཁ 1)1 foo = 2; echo $obj->foo;

Slide 34

Slide 34 text

ݹ͍ϥΠϒϥϦ NZTRM@DPOOFDU SFRVJSF@PODF 1&"3ͷޡ༻

Slide 35

Slide 35 text

NZTRM@DPOOFDU ݹདྷΑΓ࢖ΘΕ͖ͯͨؔ਺ 1)1͔Βඇਪ঑ɺഇࢭ༧ఆ NZTRMJ@DPOOFDU1%0Λ࢖͏

Slide 36

Slide 36 text

SFRVJSF@PODF ผϑΝΠϧͷϥΠϒϥϦͷಡΈࠐΈ ͱʹ͔͋͘Ε͜ΕಡΈࠐΈ·͘Γ͕ͪ BVUPMPBEػߏ͕ग़དྷͨͷͰෆཁʹ

Slide 37

Slide 37 text

1&"3 ོ͔ͭͯ੝ΛތͬͨϥΠϒϥϦ܊ ݫ֨ͳެࣜνϟωϧ ݱଘ͢ΔϑϨʔϜϫʔΫ౳ͷૅ Πϯετʔϥʔ͕࢖͍ʹ͍͘ ίϐʔ͞Εվม͞Εɺߋ৽ෆೳʹ

Slide 38

Slide 38 text

1&"3 ิ଍ ݱࡏ΋1)16OJU΍4NBSUZͳͲ1&"3ϕʔ εͷϥΠϒϥϦ͸׆ൃ ઃఆ΍1ZSVTͳͲʹΑΔରॲ๏΋͋Δ ਖ਼͘͠ར༻͠ɺద੾ʹӡ༻͞Ε͍ͯΕ ͹໰୊ͳ͍ ໰୊͸ޡ༻͞ΕΔ͜ͱ

Slide 39

Slide 39 text

͋ͳͨͷίʔυʹ͜͏͍ ͬͨ಺༰͕ଟ͍ͱةݥ

Slide 40

Slide 40 text

ϨΨγʔ1)1ɺɹۦஞͯ͠΍Δʜ ͜ͷੈ͔ΒʜɹҰߦʜ࢒Βͣ

Slide 41

Slide 41 text

ϞμϯͳϓϥΫςΟε

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

1)15IF3JHIU8BZ 4MJN'SBNFXPSLͷ࡞ऀ+PTIࢯ͕ൃىਓ 1)1ͷϕετϓϥΫςΟε (JU)VC্Ͱ֤ݴޠʹ຋༁͞Εͨ ͜ͷ಺༰Λक͍ͬͯΕ͹Ϟμϯ

Slide 44

Slide 44 text

ͷϓϥΫςΟε ͸͡Ίʹ ίʔσΟϯάελΠϧ ݴޠ࢓༷ ґଘؔ܎ͷ؅ཧ ίʔσΟϯάʹؔ͢Δ׳श σʔλϕʔε ηΩϡϦςΟ ςετ ֤छαʔόʔ΁ͷσϓϩΠ Ωϟογϡ ৘ใݯ ίϛϡχςΟ

Slide 45

Slide 45 text

͸͡Ίʹ 1)1Ҏ߱Λ࢖͏ .BD049ͷ1)1͸ݹ͍IPNFCSFX 8JOEPXT͸৭ʑ͋Γ͗͢ 7BHSBOU΋ศར

Slide 46

Slide 46 text

7BHSBOU 7JSUVBM#PYΛΠϯετʔϧ 7BHSBOUΛΠϯετʔϧ ޷͖ͳ7BHSBOUpMFΛDMPOF WBHSBOUVQ ׬શʹઃఆ͞ΕͨԾ૝Ϛγϯ͕ىಈ

Slide 47

Slide 47 text

ίʔσΟϯάελΠϧ 143143143 1)1$PEF4OJ⒎FS 1)1$PEJOH4UBOEBSET'JYFS

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

େࣄͳͱ͜Ζ ϑΝΠϧ໊ɺύε ΠϯσϯτɺϒϨʔεͷҐஔ 1)14UPSNͳͲͷ*%&ͰݕࠪՄೳ

Slide 50

Slide 50 text

ݴޠ࢓༷ͷϙΠϯτ 001ແ໊ؔ਺໊લۭؒτϨΠτ Ϋϩʔδϟ ϝλϓϩάϥϛϯά 41-$-* 9%FCVH

Slide 51

Slide 51 text

DMBTTͷڭࣨ

Slide 52

Slide 52 text

ґଘؔ܎ͷ؅ཧ $PNQPTFS͸ϓϩδΣΫτ಺ґଘؔ܎ 1&"3͸γεςϜશମͷґଘؔ܎ ࠷৽൛΁ͷߋ৽΍੬ऑੑνΣοΫ ϥΠϒϥϦQBDLBHJTUͰ୳ͤ͹Α͍

Slide 53

Slide 53 text

$PNQPTFS DVSMTIUUQTHFUDPNQPTFSPSH JOTUBMMFScQIQ DPNQPTFSKTPO DPNQPTFSJOTUBMM SFRVJSFbWFOEPSBVUPMPBEQIQ` SFRVJSF͸͜Ε͚ͩ

Slide 54

Slide 54 text

ίʔσΟϯά جຊ ೔෇΍࣌ࠁ%BUF5JNF σβΠϯύλʔϯ'BDUPSZ4JOHMFUPOϑ ϩϯτίϯτϩʔϥ.7$ ྫ֎ॲཧ

Slide 55

Slide 55 text

جຊ ൺֱԋࢉࢠ JGFMTF TXJUDI γϯάϧΫΦʔτɺμϒϧΫΦʔτ ࡾ߲ԋࢉࢠ

Slide 56

Slide 56 text

σʔλϕʔε 1%0 NZTRM@DPOOFDU ͸ഇࢭ༧ఆ 1%0͸൚༻త͔ͭߴػೳ όΠϯυΛઈର࢖͏

Slide 57

Slide 57 text

όΠϯυ

Slide 58

Slide 58 text

ηΩϡϦςΟ ύεϫʔυͷϋογϡQBTTXPSE@IBTI σʔλͷϑΟϧλϦϯά αχλΠζ όϦσʔγϣϯ 3FHJTUFS(MPCBMT1)1Ͱഇࢭ

Slide 59

Slide 59 text

݁࿦ɿಙؙຊΛങ͏

Slide 60

Slide 60 text

ςετ Ϣχοτςετ1)16OJU౳ ػೳςετ4FMFOJVN ৼ෣ۦಈ։ൃ#%%#FIBU1)14QFD

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

σϓϩΠ 1BB4 OHJOYQIQGQNলϝϞϦ "QBDIFNPE@QIQ 1IJOH$BQJTUSBOP$IFG $* +FOLJOT 5FBNDJUZ

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

Ωϟογϡ όΠτίʔυΩϟογϡ "1$9$BDIF;FOE0QUJNJ[FS8JO$BDIF ΦϒδΣΫτΩϟογϡ "1$.FNDBDIF3FEJT

Slide 66

Slide 66 text

5IF3JHIU8BZ த্ڃऀʹͱͬͯ͸౰ͨΓલͷ಺༰ ௕೥ͷࢼߦࡨޡͷ஝ੵͷ݁Ռ ॾࣄ৘͸͋ͬͯ΋ɺैͬͯଛ͸ແ͍

Slide 67

Slide 67 text

΍ͬͯΈΑ͏ʂ

Slide 68

Slide 68 text

࡞Δ΋ͷ 7BHSBOUͰಈ͘ $PNQPTFSͰϥΠϒϥϦΛಋೖ 5XJUUFS͔Β৘ใऔಘ

Slide 69

Slide 69 text

7BHSBOU 7JSUVBM#PY7BHSBOU IUUQTHJUIVCDPNZBOEPEQIQ OHJOYWBHSBOUTBNQMF HJUDMPOF WBHSBOUVQ

Slide 70

Slide 70 text

Slide 71

Slide 71 text

DPNQPTFSKTPO WBHSBOUTTI DEWBHSBOU@EBUBTBOECPY DPNQPTFSKTPOΛهड़͢Δ ࣗಈͰ΋खಈͰ΋Ͱ͖Δ

Slide 72

Slide 72 text

DPNQPTFSKTPO { "name": "llmatsuri/sample", "authors": [ { "name": "yando", "email": "[email protected]" } ], "require": { "dg/twitter-php": "*" } }

Slide 73

Slide 73 text

DPNQPTFSKTPO ΄͍͠ϥΠϒϥϦΛݕࡧͯ͠ࢦఆ͢Δ 8FCͰ΋ίϚϯυͰ΋ݕࡧͰ͖Δ ࣮͸1&"3΋ΠϯετʔϧͰ͖Δ ࠷ޙʹDPNQPTFSJOTUBMMͰ·ͱΊͯ%-

Slide 74

Slide 74 text

DPNQPTFSJOTUBMM vagrant@precise64:/vagrant_data$ composer install Loading composer repositories with package information Installing dependencies (including require-dev) - Installing dg/twitter-php (v3.1) Loading from cache Writing lock file Generating autoload files

Slide 75

Slide 75 text

JOTUBMM͢Δͱ DPNQPTFSMPDL͕ੜ੒͞ΕΔ WFOEPSҎԼʹϥΠϒϥϦ͕%-͞ΕΔ WFOEPSҎԼʹΦʔτϩʔμ͕഑ஔ

Slide 76

Slide 76 text

࢖༻ޙ

Slide 77

Slide 77 text

BVUPMPBE BVUPMPBEQIQ͚ͩΛSFRVJSF͢Δ ඞཁͳ࣌ʹ֤ΫϥεΛࣗಈͰಡΈࠐΉ ೋ౓ͱSFRVJSF@PODFΛॻ͔ͳ͍ ϑϨʔϜϫʔΫ͕ಡΈࠐΉ৔߹΋͋Δ

Slide 78

Slide 78 text

JOEFYQIQ

Slide 79

Slide 79 text

Τϥʔʁ 5XJUUFSΫϥε͸ίϯγϡʔϚΩʔͱ ίϯγϡʔϚγʔΫϨοτ͕ඞཁΒ͍͠

Slide 80

Slide 80 text

EFWUXJUUFSDPNBQQT αΠϯΞοϓ ΞϓϦΛ࡞੒ ੜ੒͞ΕͨΩʔ৘ใΛίϐͬͯ࢖͏

Slide 81

Slide 81 text

औಘ loadUserInfo('yando'); var_dump($info->status->text);

Slide 82

Slide 82 text

͓͓ʂ

Slide 83

Slide 83 text

͋ͱ͸ ϥΠϒϥϦΛDPNQPTFSKTPO΁௥Ճ DPNQPTFSVQEBUFͰߋ৽ WFOEPSΛίϛοτ͠ͳ͍ σϓϩΠ࣌ʹJOTUBMMͰWFOEPSΛ࠶ੜ

Slide 84

Slide 84 text

͞Βʹ 143Λक͍ͬͯΕ͹ࣗ࡞ΫϥεͰ΋ BVUPMPBEʹରԠͰ͖Δ 1&"3ͳͲ΋DPNQPTFSͰΠϯετʔϧ ίʔυ΍ϦϙδτϦ͕εοΩϦ

Slide 85

Slide 85 text

࣭໰ʁ