Slide 1

Slide 1 text

QIBSʹΑΔϫϯόΠφϦΞϓϦέʔ γϣϯͷՄೳੑΛ୳ͬͯΈͨ !HPPEPP  QIQDPOEP

Slide 2

Slide 2 text

• גࣜձࣾαΠόʔΤʔδΣϯτ • 4(&౷ׅຊ෦ٕज़౷ׅࣨࣨ௕ • ࢠձࣾࣾ$50 • גࣜձࣾ$SBGU&HH • גࣜձࣾδʔΫϨετ • גࣜձࣾαϜβοϓ • നҪɹӳ • ΤϯδχΞ • #MPH IUUQBNFCMPKQHPPEPP ͓લɺ୭Α • 5XJUUFS !HPPEPP • %2 ͙ͪ͢Ή '# 
 ϓΫϦϙ ཱྀܳਓ

Slide 3

Slide 3 text

"HFOEB wϫϯόΠφϦ w1IBS wQIBSͷར༻Λศརʹ͢ΔϥΠϒϥϦ w)551αʔόʔΛϫϯόΠφϦͰ w·ͱΊ

Slide 4

Slide 4 text

ϫϯόΠφϦ

Slide 5

Slide 5 text

ϫϯόΠφϦɾɾɾ ͍͍ڹ͖Ͱ͢Ͷ

Slide 6

Slide 6 text

(PͰϏϧυͨ͠ όΠφϦ͸ ϫϯόΠφϦͰ ಈ͖·͢Ͷ

Slide 7

Slide 7 text

഑෍෺ͷϙʔλϏϦ ςΟ͕ॏཁͰ͢Ͷ

Slide 8

Slide 8 text

σϓϩΠ͕̍ϑΝΠϧ ͍͍ͬͯͰ͢Ͷ

Slide 9

Slide 9 text

(P͍ͬͯ͢͝Ͱ͢Ͷ

Slide 10

Slide 10 text

1)1Ͱ Ͱ͖ͳ͍ͷʁ

Slide 11

Slide 11 text

(PʹͰ͖ͯ 1)1ʹͰ͖ͳ͍ Θ͚͕ͳ͍

Slide 12

Slide 12 text

1IBS

Slide 13

Slide 13 text

ಥવͰ͕࣭͢໰Ͱ͢

Slide 14

Slide 14 text

1IBSͳΜͯಡΈ·͔͢ʁ  ͽʔ΁͍ͪ͑ʔ͋ʔΔ  ͺʔ  ;͊ʔ

Slide 15

Slide 15 text

ࢲ͸  ͷʮ;͊ʔʯͰ͢ ;͊ʔ

Slide 16

Slide 16 text

1)1FS΋ ϫϯόΠφϦͰ σϓϩΠ͍ͨ͠

Slide 17

Slide 17 text

ͦ͜Ͱ1IBS

Slide 18

Slide 18 text

1IBSͬͯԿʁ 1IBSΞʔΧΠϒ͸ɺෳ਺ͷϑΝΠϧΛͻͱͭ ʹ·ͱΊΔͨΊͷศརͳ࢓૊ΈͰ͢ 1IBSΞʔΧΠϒΛ࢖༻͢Ε͹ɺ1)1ͷΞϓ ϦέʔγϣϯΛͻͱͭͷϑΝΠϧͱͯ͠഑෍Ͱ ͖ΔΑ͏ʹͳΓ·͢ɻ·ͨɺͦΕΛσΟεΫ্ ʹల։͠ͳͯ͘΋ͦͷ··࣮ߦͰ͖ΔͷͰ͢ Ҿ༻ɿ1)1ϚχϡΞϧ IUUQTXXXQIQOFUNBOVBMKBJOUSPQIBSQIQ

Slide 19

Slide 19 text

1IBSΞʔΧΠϒΛ࢖༻͢Ε͹ɺ 1)1ͷΞϓϦέʔγϣϯΛͻͱͭ ͷϑΝΠϧͱͯ͠഑෍Ͱ͖ΔΑ͏ʹ ͳΓ·͢ ·ͨɺͦΕΛσΟεΫ্ʹల։͠ͳ ͯ͘΋ͦͷ··࣮ߦͰ͖ΔͷͰ͢

Slide 20

Slide 20 text

ͦͷ··࣮ߦͰ͖Δ

Slide 21

Slide 21 text

Ͱ͸࣮ࡍʹ࡞੒ํ๏Λ Έ͍͖ͯ·͠ΐ͏

Slide 22

Slide 22 text

$phar = new Phar('hoge.phar'); $phar->addFromString('hoge.php', file_get_contents('./hoge.php')); $phar->setStub("

Slide 23

Slide 23 text

$phar = new Phar('hoge.phar'); $phar->addFromString('hoge.php', file_get_contents('./hoge.php')); $phar->setStub("

Slide 24

Slide 24 text

$phar = new Phar('hoge.phar'); $phar->addFromString('hoge.php', file_get_contents('./hoge.php')); $phar->setStub("

Slide 25

Slide 25 text

໘౗͍͘͞ʁ

Slide 26

Slide 26 text

QIBSͷར༻Λศརʹ͢Δ ϥΠϒϥϦ

Slide 27

Slide 27 text

͖ͬ͞ͷखॱΛ ΑΖ͘͠΍ͬͯ͘ΕΔ ϥΠϒϥϦ

Slide 28

Slide 28 text

QIBSDPNQPTFS IUUQTHJUIVCDPNDMVFQIBSDPNQPTFS

Slide 29

Slide 29 text

DPNQPTFSKTPO Λ࢖ͬͯ ΞϓϦέʔγϣϯ ࡞ͬͯ·͢ΑͶʁ

Slide 30

Slide 30 text

{ "name": "goodoo/hoge-phar", "description": "hoge phar", "authors": [ { "name": "goodoo } ], "bin": [ "./hoge.php" ], "require": { "guzzlehttp/guzzle": "~6.0" } } DPNQPTFSKTPOʹʮCJOʯͷ߲໨ʹ ΤϯτϦʔϙΠϯτͱͳΔ QIQϑΝΠϧΛࢦఆ͢Δ͚ͩ

Slide 31

Slide 31 text

$ php -d phar.readonly=false phar-composer.phar build . ͦͯ͠Ϗϧυʂ

Slide 32

Slide 32 text

͓खܰʂ

Slide 33

Slide 33 text

ͳΜ͚ͩͲ ڧେͳϓϩδΣΫτ͸ Ϗϧυࣦഊ͢Δɾɾ ˞໌֬ͳ৚݅͸͓͔͚ͬͯͳ͍ͷͰ؀ڥʹΑΔ͔΋͠Ε·ͤΜ

Slide 34

Slide 34 text

(PΈ͍ͨʹ ϫϯόΠφϦʔͰ )551αʔόʹ ͳΓ͍ͨ

Slide 35

Slide 35 text

)551αʔόʔΛ ϫϯόΠφϦͰ

Slide 36

Slide 36 text

)551αʔόʔΛ 1)1୯ମͰʂ

Slide 37

Slide 37 text

ͦ͜Ͱ4XPPMFΛͭ ͔ͬͨϑϨʔϜϫʔΫ 4XPGUͷग़൪

Slide 38

Slide 38 text

1)1ͰΠϕϯτۦಈͷඇಉظ ˍίϧʔνϯϕʔεͷฒߦॲཧ

Slide 39

Slide 39 text

4XPGU https://www.swoft.org/

Slide 40

Slide 40 text

•Base on Swoole extension •Built-in HTTP, TCP, WebSocket Coroutine Server •Powerful AOP (Aspect Oriented Programming) •Flexible and comprehensive annotations framework •Global dependency injection container •PSR-7 based HTTP message implementation •PSR-14 based event manager •PSR-15 based middleware •PSR-16 based cache design •Scalable high performance RPC •Holistic service governance, fallback, load balance, service registration and discovery •Database ORM •Universal connection pools •Mysql, Redis, RPC, HTTP Coroutine Clients •Coroutine driver client and blocking driver client seamlessly switch automatically •Coroutine and asynchronous task delivery •Custom user processes •RESTful supported •Internationalization (i18n) supported •High performance router •Fast and flexible parameter validator •Alias mechanism •Powerful log component •Cross-platform application auto- reload mechanism https://github.com/swoft-cloud/swoft ͷREADMEͷӳ༁ Ҿ༻ɿ

Slide 41

Slide 41 text

4XPGUʹ͸QBDLίϚ ϯυ͕༻ҙ͞Ε͍ͯΔ ˞WܥͷΈ

Slide 42

Slide 42 text

$ php bin/swoft app:pack --help Description: pack project to a phar package Usage: bin/swoft app:pack [--dir DIR] [--output FILE] Options: --dir STRING Setting the project directory for packing. default is current work-dir.(/Users/a11924/Git/isucon8-swoft) --fast BOOL Fast build. only add modified files by git status -s --refresh BOOL Whether build vendor folder files on phar file exists(False) -o,--output STRING Setting the output file name(app.phar) -c, --config STRING Use the defined config for build phar. Example: bin/swoft app:pack Pack current dir to a phar file. bin/swoft app:pack --dir vendor/swoft/devtool Pack the specified dir to a phar file. BQQQBDL

Slide 43

Slide 43 text

ࢼ͠ʹલճൃදͰͭͬ͘ ͨϓϩδΣΫτΛQBDL

Slide 44

Slide 44 text

$ php app.phar start Server Information ******************************************************************** * HTTP | host: 0.0.0.0, port: 8888, type: 1, worker: 1, mode: 2 * TCP | host: 0.0.0.0, port: 8099, type: 1, worker: 1 (Disabled) ******************************************************************** Server has been started. (master PID: 7533, manager PID: 7534) You can use CTRL + C to stop run. ىಈʂ

Slide 45

Slide 45 text

ಈ͍ͯΔʂ

Slide 46

Slide 46 text

1)1Ͱ΋ ϫϯόΠφϦʔͰ )551αʔόʹ ͳΕͨʂ

Slide 47

Slide 47 text

͍͍͜ͱ͹͔Γ Ͱ͸ͳ͍

Slide 48

Slide 48 text

Ϗϧυ͕࣌ؒ௕͍ɾɾ

Slide 49

Slide 49 text

$ php bin/swoft app:pack --help Description: pack project to a phar package Usage: bin/swoft app:pack [--dir DIR] [--output FILE] Options: --dir STRING Setting the project directory for packing. default is current work-dir.(/Users/a11924/Git/isucon8-swoft) --fast BOOL Fast build. only add modified files by git status -s --refresh BOOL Whether build vendor folder files on phar file exists(False) -o,--output STRING Setting the output file name(app.phar) -c, --config STRING Use the defined config for build phar. Example: bin/swoft app:pack Pack current dir to a phar file. bin/swoft app:pack --dir vendor/swoft/devtool Pack the specified dir to a phar file. ŠGBTUΦϓγϣϯͷ ࠩ෼Ϗϧυͷར༻͕Αͦ͞͏

Slide 50

Slide 50 text

·ͱΊ

Slide 51

Slide 51 text

1IBS͸1)1ͷΞϓϦ έʔγϣϯΛ࣮ߦՄೳͳ ঢ়ଶͰͻͱͭͷϑΝΠϧ ʹ·ͱΊΔ͜ͱ͕Ͱ͖Δ

Slide 52

Slide 52 text

4XPGUͷϑϨʔϜϫʔΫͷ QBDLίϚϯυͰ ϫϯόΠφϦͰ࣮ߦՄೳͳ )551αʔό͕ 1)1Ͱ΋Ͱ͖Δ

Slide 53

Slide 53 text

(PͰͰ͖Δ͜ͱ͸ 1)1Ͱ΋Ͱ͖Δ ͋͘·Ͱݸਓͷײ૝Ͱ͢

Slide 54

Slide 54 text

͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠