知られざる世界 〜WEB以外のPHP〜

271fad8d53cd1f12f2b4b6d38e3d7bd3?s=47 uzulla
August 05, 2017

知られざる世界 〜WEB以外のPHP〜

uzulla
builderscon tokyo 2017
2017/08/05

271fad8d53cd1f12f2b4b6d38e3d7bd3?s=128

uzulla

August 05, 2017
Tweet

Transcript

  1. ஌ΒΕ͟Δੈք ʙWEBҎ֎ͷPHPʙ 2017/08/05 builderson tokyo 2017

  2. WHO AM I » uzulla » PHPer » Hachioji

  3. » ॴ࣋͠Ό΋͡ » ίϐϖʢεϐʔΧʔ෼ʣ » ੬ऑੑʢݸਓεϙϯαʔ ෼ʣ

  4. ஌ΒΕ͟Δੈքͱ͸ Έͳ͞Μ͕ීஈݟͳ͍PHPͷੈքͰɺ͞Βʹ࿩୊ʹͳΒ ͳ͍PHPͷָ͠Έʹ͍ͭͯ࿩͠·͢ɻ ʢͨͱ͑͹ɺawesome-phpʹ͸ͷΒͳ͍Α͏ͳ΋ͷͷ ͜ͱͰ͢ʣ ͳ͓ɺࠓ೔͸೔༵೔Ͱ͸ͳ͘౔༵೔Ͱ͢(ωλ͕௨͡Δ ͔Θ͔Βͳ͍) جຊతʹ͸ࢲͷझຯͰ͢ɻPHP͕झຯͳͷͰɻ

  5. » PHPΛ΍͍ͬͯΔํɺ͜͜ʹͲΕ͘Β͍͍Βͬ͠Ό ͍·͢ʁ » PHPҎ֎ͷํ΋ʮPHPʹͰ͖Δ͜ͱͳΜͰʯɺͨͿ ΜͦͪΒͷݴޠͰ΋Ͱ͖·͢Ͷɻ ͨͷ͠Έ·͠ΐ͏ɻ » ͳ͓ɺ͜ͷձ৔͜ͷ࣌ؒ͸ே৯ͱίʔώʔ͕͍ͨͩ ͚·͢ʂͦͪΒ΋ੋඇָ͠Έ·͠ΐ͏ɺݎۤ͘͠ͳ

    ͍ײ͡Ͱ૒ํ͍͚Ε͹޾͍Ͱ͢ɻ
  6. DISCLAIMER » Don't take anything as truth. » Totally my

    personal point of view.
  7. !"# WHY PHP?

  8. !"# I'M PHPER, THAT IS WHY.

  9. ୈ1ूɺPHP͸εϚϗͷເΛݟΔ͔ʁ ݱࡏͷϓϩάϥϛϯάͷՖܗͱ͍͑͹ɺεϚϗΞϓϦɻ ͸ͨͯ͠εϚϗΞϓϦ͸PHPͰ࡞Δࣄ͕Ͱ͖Δͷ͔ʁ

  10. Ͱ͖Δʹ͖·͍ͬͯΔʂʂ (ओ؍)

  11. PHAP

  12. None
  13. None
  14. ͍͢͝ʂʂ (͍ΖΜͳҙຯͰʣ

  15. » Reddit΍HackerNewsͰ΋࿩୊ʹɺϒΫϚ΋͍ͭͨ » https://news.ycombinator.com/item? id=10901307 » https://www.reddit.com/r/PHP/comments/ 40xcjt/phapmobileappsinphp/ » http://b.hatena.ne.jp/entry/

    phap.landingpage.io/ (67ϒΫϚ)
  16. ࢲʮࠓ͙͢ొ࿥΍ʂʂʯ

  17. ବ՛ࢠ՛ࢠ

  18. » http://phap.landingpage.io/ <= 404 » https://web.archive.org/web/20160728132616/ http://phap.landingpage.io:80/ <= ?

  19. » Ұ౓΋ϦϦʔεͳͲ͸ͳ͘ɺফ͑·ͨ͠ » ·͋ɺδϣʔΫͩͬͨΜͰ͠ΐ͏ » (ϝϧΞυΛूΊΔ࠮ٗͩͬͨͷͰ͸ʁ) » (ͳ͓ɺফ͑ͨ͜ͱ͸࿩୊ʹͳΒͳ͔ͬͨɺ΢Υον ͯͨ͠ͷ͸ࢲ͘Β͍ͩΖ͏…)

  20. ʮ҆Β͔ʹ຾Ε…ʯ

  21. (Έͳ͞Μͷ৺ڥ) ʮ͑ͬɺ·͔͞ͷӕͩͬͨͷʂʁʯ (ࢲ) ʮ·͋଴ͬͯʯ

  22. kikApp

  23. None
  24. None
  25. None
  26. ࠓ͙͢μ΢ϯϩʔυͰ͖Δʂʂ » (Ϣʔβʔొ࿥͸ඞཁͰ͢)

  27. σϞ » ࢼ͠ʹ࡞ͬͯΈͨ » Android apk » http://bit.ly/2tR5MaN

  28. ౰ͨΓલ͚ͩͲɺ » ࣮ػͰ΋͏͖͝·͢ » https:// photos.app.goo.gl/ ZrliqfsCTE65A9bt2 » ݟ͍ͨਓ͸ޙͰ੠͔͚ͯԼ ͍͞

  29. ࢼ͠ํ » android൛ΛϏϧυ͢ΔྲྀΕ

  30. ࣄલʹ » java8ΛDLͯ͠ೖΕΔ » ʢ7ͩͱɺॺ໊ͰίέΔʣ » Android studioΛೖΕΔ » Android

    SDK͚ͩͰ΋͍͍͔΋
  31. » େମͷ৘ใ͸wikiʹ͋Δʢ͔΋͠Εͳ͍ʣ » https://wiki.kikapptools.com/ » αΠϯΞοϓͯ͠downloadϦϯΫΛͨͲΔ » CLIΛͱΓ͋͑ͣDLͯ͠ղౚ

  32. ղౚͨ͠ϑΝΠϧͷதͷɺ AndroidConfiguration.propertiesΛฤू͢Δ ### jdkͱ͍͍ͭͭɺbin·ͰೖΕΔ jdk_directory=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home/bin/ ### android_sdkͷ৔ॴ͸ ~/Library/Android/sdk android_sdk=/Users/uzulla/Library/Android/sdk

  33. ղౚͯ͠Ͱ͖ͯͨkikappΛىಈ͢Δͱɺॳճ͸Ϣʔβʔ IDͱPasswordΛฉ͔ΕΔͷͰೖྗ $ ./kikapp You need to login User >

    uzulla Password > ****** Hi, uzulla!! KikApp > kikAppͷγΣϧ্ཱ͕͕ͪΔ
  34. ͦͷ··kikappͷshellͰ৽نϓϩδΣΫτΛ࡞Δ KikApp > new -testapp -/tmp/kikappsrc/ » testapp͕ΞϓϦ໊ ʢΞϓϦ໊͸ॏෳෆՄʣ »

    /tmp/kikappsrc/ ͕ϕʔεσΟϨΫτϦʹͳΓ ʢϑϧύεΛࢦఆ͠ͳ͍ͱɺޙʑॺ໊ͰίέΔʣ ʢύεʹϋΠϑϯ͕͋ΔͱΤϥʔʹͳΔʢʣʣ » /tmp/kikappsrc/testapp ʹϑΝΠϧ͕࡞ΒΕΔ ʢ͜͜Β΁Μ৭ʑΞϯυΩϡϝϯτͳ᠘ָ͕͔͋ͬͯͬͨ͠ʢʣʣ
  35. Ұ౓ดͨ͡ʢkikAppΛऴྃͨ͠ʣ৔߹ɺ࠶౓։͘ʹ͸ γΣϧ͔ΒҎԼͷΑ͏ʹ KikApp > open -/tmp/kikappsrc/testapp

  36. /tmp/kikappsrc/projectͷத ʹίʔυ͕͋Γɺ main.php͕ओͱͳΔϑΝΠϧ Ͱ͋ΔͷͰमਖ਼ɻ ͦͯ͠Ϗϧυ KikApp > build (Ϗϧυ͸ͳʹΛ΍͍ͬͯΔͷ ͔Α͘Θ͔Βͳ͍͕ɺ݁ߏͳ

    ͕͔͔࣌ؒΔ)
  37. » ʮ΍ͬͨͥɺ͍ͭʹPHPerʹ΋ಌΕͷʰίϯύΠϧத Ͱ͔͢Βʱͱ͍͏ݴ͍༁ʢʁʣ͕Ͱ͖Δʂʯ » ͜ͷ࣌ɺAndroid/main/build/outputs/apk/ҎԼʹ apk͕Ͱ͖͍ͯΔ

  38. KikApp > run ͢ΔͱɺAndroidΤϛϡϨʔλ্ཱ͕͕ͪΔ …ϋζΒ͍͠ͷ͕ͩɺ্ཱ͕ͪͬͨࢼ͠͸ͳ͍ खಈͰAndroid Studio͔ΒԾ૝ϚγϯΛͭ͘ΓɺͦΕ Λىಈͨ͠··run͢Δͱಈ͘ɻ

  39. ͱ͍ͬͨͳΜ΍͔Μ΍Ͱ

  40. None
  41. <?php // ͳΜͱ͜ΕͰίʔυશମͰ͢ $win = new SDPanel(); $win -> setCaption("Hello

    world!"); $mainTable = new Table(); $button = new Button(); $button -> setCaption("Click me!"); $button -> onTap(clickme()); $mainTable -> addControl($button,1,1); $win -> addControl($mainTable); function clickme(){ echo "hello smartphone!"; } ?>
  42. ରԠػछ » iOS ʢͨΊͯ͠ͳ͍͕ʣ » Android ʢ̓Ͱࢼͨ͠ʣ

  43. ΍ͬͨͥʂ͜ΕͰPHP΋͖͔ͨʂʁ

  44. ·ͣམͪண͍ͯཉ͍͠ɻ ͱ͜ΖͰ͜ͷίʔυΛݟͯ͘Εͳ͍͔ɻ

  45. <?php function clickme(){ echo "hello smartphone!"; } » ͜ͷΑ͏ʹecho͢ΔͱμΠΞϩά͕ग़Δ »

    (PHPʹৄ͍͠ਓ)ʮʂʁʯ
  46. ݏͳ༧ײ͕͖ͯͨ͠

  47. <?php $button->onTap(clickme()); function clickme(){ /*ʙ*/ } » ίʔϧόοΫؔ਺Λొ࿥͢ΔίʔυͰ͋Δ » ʢ౰વͳ͕Βʣ͜Ε͸ؔ਺Ͱͳ͘ɺධՁʮޙʯΛ౉

    ͢ίʔυͳͷͰ͸ʁʁʁ
  48. // Ϗϧυ࣌Τϥʔϝοηʔδ Generating to main.php line 17:0 missing '?>' at

    '<EOF>' » ࠷ޙͷ?>ΛলུͰ͖ͳ͍ » ʢ࠷ۙ͸লུ͢Δͷ͕౰વʣ
  49. $city = new InputText(); $city -> setReadOnly(true); function refresh(){ //

    ུ $city = $struct['nombreCiudad']; } » ʮಥવม਺͕άϩʔόϧʹʂʁʯ » ʢPHPerͰͳ͍ํʹઆ໌͢Δͱɺ͜ΕͰ͸άϩʔό ϧม਺ʹͳΒͳ͍ʣ
  50. ༧ײ͕࣮ײ

  51. ͜Ε͸ຊ෺ͷPHPͰ͸ͳ͍ʂ ʢόόʔϯʣ

  52. ūɹūƃŦƄŕũŖ!! Ω ΩΩ

  53. » ͭ·Γ͜Ε͸PHP෩ͷߏจΛ΋ͬͨผͷφχΧͰ ͢ʂ » ͍΍ɺ͜Ε͸PHPͱ͍ͬͯ΋͍͍ͷͰ͸ͳ͍͔…ଟ ෼…ͦ͏͍͏͜ͱʹ͠Α͏ʂʂ » PHPͱ׬શޓ׵Ͱͳ͍PHP͸ී௨Ͱ͢ɺPHPʹ͸ॲ ཧܥ͕ͦΕͳΓʹ͋ΔͷͰ͢ »

    (Pythonͱ͔Javaͱ͔.netͱ͔Erlang(?!)ͱ͔ʣ » ʢͱ͸͍͑ɺkikAppͷPHP͸จ๏΋ҧ͍͗͢ΔͷͰ ͸ͳ͍͔…ʣ
  54. » PHPͰΞϓϦͱ͸ҰମͳΜͩͬͨͷ͔ » ؔ਺΍Ϋϥε΋શ໓Ͱ͢ɺ͋Γ͕ͱ͏͍͟͝·ͨ͠ » (͜͜·ͰͨͲΓண͍ͨ࣌ͷࢲͷ৺ڥΛ૝૾͠ɺ140 จࣈҎԼͰTwitterʹड़΂Α)

  55. ଞʹ΋… » ৘ใ͕ͱʹ͔͘ແ͍ » αϯϓϧίʔυ͸݁ߏ͋Δ͕… » StackOverflow΁ͷϦϯΫ͕͋Δ͕ɺ0݅ʢসʣ » ϦϞʔτ΁ͷ௨৴͕ϔϯςί »

    file_get_contents΍curl͸͔ͭ͑ͳ͍ɺ ṖͷHTTP ClientΫϥεϥΠϒϥϦΛ͔ͭ͏ » ௨৴͸ɺඞͣαʔόʔʹઃஔͨ͠ʢੜ੒ͨ͠ʣ PHPͷProxyΛҰ౓ܦ༝͢Δʢඞવੑ͕Ṗʣ
  56. » json ͷύʔε͕ʮߏ଄ମΛͭͬͯ͘ɺϙΠϯλ͔ͭ ͬͯύʔε͢ΔʯΈ͍ͨͳײ͡Ͱ΢έΔʢʁʁʣ $result = $httpClient -> Execute('GET',$url); $struct

    = array( array( "id" => DataType::Numeric(6), "name" => DataType::Character(150), ) ); Data::FromJson($struct,$result); foreach ($struct as $product){ $id = $product['id']; $title = $product['name']; }
  57. ·ͱΊ » ϋολϦɺҰൃωλͱͯ͠͸ڧ͍(͔ͭΈʹ࠷ߴ) » ίʔυ͸࣮ࡍʮ௒؆୯ʯɺίʔυ௒୹͍ » ·ͬͨ͘PHPerͷࢥ͍௨Γʹ͸Ͱ͖ͳ͍(স » ʢͳ͔ͥʣ௨৴ʹ͸αʔόʔ͕ඞཁ »

    Πϯετʔϧগʑ໘౗ɺυΩϡϝϯτ͕ແ͍ » কདྷతʹϥΠηϯε΍Ձ͕֨Ͳ͏ͳΔͷ͔Ṗ » फڭͰPHPҎ֎͔ͭ͑ͳ͍ਓʹ͸Αͦ͞͏(ʁ)
  58. ײ૝ » ʮͰ΋ɺຊ౰ʹͰ͖ͨΑʂVaperware͡Όͳ͍ʂ͢ ͍͝ʂʂʯ » PHPͷߏจΛDSLʹ͢Δͱ͔୭͕خ͍͠ͷ͔(ࢲͩʂ » ͜ͷ౒ྗ͸ೝΊΔɺͱ͍͏͔৆ࢍ͍ͨ͠ » কདྷʹظ଴ʢʁʣʢ·ͩ͡Θ͡Θίϛοτ͸͋Γ·

    ͢ʣ
  59. ࢀߟࢿྉ » https://www.kikapptools.com/ » https://www.kikapptools.com/show-case/ » https://wiki.kikapptools.com/ » https://github.com/KikAppTools/ KikAppExamples

    » https://github.com/KikAppTools/KikAppDemos
  60. ୈҰू׬

  61. ͸͍ ຊ೔͜Μͳײ͡Ͱ͍͖·͢ΜͰ

  62. ୈЋू PHPͰΞϓϦ NGϫʔυɿʮ΢Σϒ͡ΌͶʔ͔ʂʯ

  63. PHPΛϩʔΧϧͷPCͰΞϓϦͱͯ͠࢖͏ʹ͸Ͳ͏͢Ε͹ Α͍͔ʁ ʮPHP͸Webαʔόʔʹஔ͘΋ͷɺͦΜͳ෩ʹ͓΋ͬͯ ͍ͨ࣌୅͕Զʹ΋͋Γ·ͨ͠ʯ ʮ͍΍ɺΦνͱͯ͠͸Web͔ͩΒͳʁʯ

  64. Ұ൪ΏΔ͍ճ౴ » ʮXAMPPͱҰॹʹzipʯʮ10೥લ͔ʯ » PHP͸૊ΈࠐΈͷελϯυΞϩϯαʔόʔ͕͋Δ » Macͱ͔ͳΒ࠷ॳ͔Β͸͍ͬͯΔ » ίʔυίϐʔͯ͠php -S

    127.0.0.1:8080 » ىಈͯ͠ϒϥ΢βͰ։͘ » ʢυοΧʔʁ͠Βͳ͍ࢠͰ͢Ͷ…ʁʣ
  65. ׬

  66. ׬Ͱ͸ͳ͍ » ʢ͍΍ɺ͘͢͝ແ೉Ͱ࣮༻తͰ͚͢ͲͶʁτʔΫʹ͸ ͳΒͳ͍ʣ » ͱ͍͏͜ͱͰ…

  67. nightrain » PHP WebΞϓϦΛ app,exeʹύοΫͰ͖Δ » PHP(όΠφϦ) +Python(ύοΫࡁ) » http://

    uzulla.hateblo.jp/ entry/ 2014/12/12/235020 » ੲࣗ෼ͷϒϩάʹॻ͍ͨ
  68. » ͚ͩͲɺࢮΜͰ·͢ » αΠτফ͑ͯόΠφϦ഑෍͕ͳ͘ͳͬͨ » Ϗϧυ͕௨Βͳ͍ » օ༷ʮ·͔ͨΑʂʯ

  69. ωλ͕ফ͑ͯ͠·͏ͷͰ » ʮ͔ͨ͠ͳ͍ɺ௚͔͢ʯ

  70. $ git clone $ pip install pyinstaller $ brew install

    wxpython $ vi Classes/Compiler.py 179ߦ໨ call(["pyinstaller.py", "--clean", "-w", "-y", "-F", spec_path, application_icon, "-n", "nightrain", "Application.py"]) ↓ call(["pyinstaller", "--clean", "-w", "-y", "-F", spec_path, application_icon, "-n", "nightrain", "Application.py"]) $ python build.py …Έ͍ͨͳ͜ͱΛ΍ͬͯΈ͚ͨͲ
  71. » Ϗϧυ͸Ͱ͖͚ͨͲ࣮ߦ͢ ΔͱηάͬͯམͪΔ » pyinstaller ͱ wx ͷ৯߹ ͤʁ »

    otool΍ install_name_toolΉ͍ͣ » ʮ͏͔ͬΓpythonͱdylib ʹৄ͘͠ͳͬͨʂ͜Ε͔ͩ ΒPHP࠷ߴʂʯ » (sierra͋ͨΓ͔Β৭ʑͳ෺ ͷϏϧυ೉қ౓্͕ͬͯͳ ͍ʁ)
  72. μϝͩ͊ PHPerʮϠό͍ɺ͜ͷ··ͩͱϓϩϙʔβϧ࠮ٗʹͳΔ ͧ…ʯ

  73. PHPerʮ͔ͨ͠ͳ͍ɺͳ͚Ε͹࡞Ζ͏ϗττΪεʯ

  74. phpack

  75. phpack » https://github.com/uzulla/phpack » Electron + PHPͰPack » NightrainΛJSͰͭ͘Γͳ͓ͨ͠Α͏ͳ΋ͷ »

    PHP͸ͱΓ͋͑ͣSystem PHPΛ͔͍ͭͬͯΔ͕ɺ fatpack΋΍Ζ͏ͱ͓΋͑͹Ͱ͖Δ » OSX༻ʢͱΓ͋͑ͣʣ
  76. ࢓૊Έ » Electron͔Βɺhttpdͱͯ͠php -SΛىಈ͢Δ » app಺ͷϑΝΠϧΛphp͕࣮ߦͯ͠αʔϒ » ElectronͰͦΕΛ։͘ » ʢϙʔτࢦఆͰϒϥ΢βͰ΋։͚Δʣ

  77. phpackʢΈ͍ͨͳ෺ͷʣ௕ॴ » ʮHTML͸ద౰ͳ੩తUIΛॻ͘ͷʹ࠷ߴʯ » JSΑΓී௨ͷॲཧ͸ॻ͖΍͍͢ » Electronͷத͔ΒPHPϑΝΠϧ܈ΛऔΓग़ͯ͠ී௨ ʹ։ൃɾσόοάͰ͖Δ

  78. ܽ఺ » Ͱ͔͍ » ਺ेKbyteͷPHP͕ » ਺ඦMbyteʹ… » (PHPόΠφϦൈ͖ͰίϨ)

  79. TODO » (΍Δؾ͕ͰͨΒ) » ࢖ΘΕ͍ͯͳ͍ϙʔτΛ࢖͏Α͏ʹ͢Δ » ӈΫϦοΫϝχϡʔΛͭ͘Δ » ໭Δͱ͔Ϧϩʔυͱ͔Λ࡞Δ »

    ແͯ͘΋Ͳ͏ʹ͔ͳΔ͕ɺ໘౗ͳͷͰ » READMEΛͪΌΜͱॻ͘
  80. » ʮ…શ෦JSͰ͍͍ͷͰ͸ʁʯ ʮͦΕPHPerͷલͰ͍͑Μͷʁʯ

  81. ͯ͞ » ͦΕΛ࢖ͬͯ… » ͳʹ͢Δͷʁ

  82. άϦονը૾ੜ੒πʔϧ » ·͋ɺԿ౓΋࡞ͬͯΔͷͰ » (ੲPerlͰॻ͍ͨ΍ͭΛద౰ʹҠ২) (https://gist.github.com/uzulla/5589791)

  83. None
  84. None
  85. ίʔυ͸ಛʹݟΔ΂͖ͱ͜Ζ͸ͳ͍͚ΕͲ <html> <head> <title>Glitch</title> </head> <body> <form action="./glitch.php" method="POST" enctype="multipart/form-data">

    <input name="random_param" value="5"> <input name="max_jump_window_param" value="0.5"> img: <input type="file" name="img"><br> <input type="submit"> </form> </body>
  86. <?php $raw = file_get_contents($_FILES['img']['tmp_name']); $max_jump_window_param = $_POST['max_jump_window_param']; $random_param = $_POST['random_param'];

    $max_jump_window = strlen($raw) * $max_jump_window_param; $offset = 100; while(1){ $total_len = strlen($raw); $offset += (int)rand(1, $max_jump_window); if($offset > $total_len){ $offset = $total_len ; } $head = substr($raw, 0, $offset); $tail = substr($raw, $offset, $total_len-$offset); $padding = get_random_str( (int)rand(0, $random_param) ); $raw = $head . $padding . $tail; if($total_len <= $offset){ break; } } header("Content-Type: ".$_FILES['userfile']['type']); echo $raw; function get_random_str($num){ $char_tmp = []; $char_tmp = array_merge($char_tmp, range('A','Z')); $char_tmp = array_merge($char_tmp, range('a','z')); $char_tmp = array_merge($char_tmp, range('0','9')); $char_tmp_len = count($char_tmp); $str = ''; for($i=1; $i<=$num; $i++){ shuffle($char_tmp); $str .= $char_tmp[0]; } return $str; }
  87. ݟΔ΂͖ͱ͜Ζ͸ಛʹͳ͍͚ΕͲ » ૈࡶૉ๿ͳίʔυͰ΋ɺͪΌΜͱπʔϧʹͰ͖Δɻ » ʮϩʔΧϧͷΞϓϦͩ͠ɺηΩϡϦςΟ͸ద౰Ͱ͑͑ ΍Ζʯ

  88. ΋͏ͻͱͭ

  89. ʮൿ఻ͷόϧΫϝʔϥʔʯ » hidden-no-bulk-mailer.app » ΧϯϑΝϨϯεӡӦͬͯϝʔϧΛͨ͘͞ΜૹΔ » աෆ଍ͳ͘ϑϦʔͳόϧΫϝʔϥ͸গͳ͍ » PHPͰॻ͚͹͍͍͕ɺαʔόʔ༻ҙͨ͘͠ͳ͍ »

    ׳ΕͨਓʹཔΓ੾ΓʹͳΓ͕ͪɺ೚ͤΒΕͳ͍ » ͱ͍͏͜ͱͰɺࣗ෼Ͱ࡞Δ͔͠ͳ͍ʢཁग़యʣ
  90. None
  91. None
  92. None
  93. ίʔυ… <html lang="ja"> <head> <meta charset="utf-8"> <title>ൿ఻ͷόϧΫϝʔϥʔ</title> </head> <body> <h1>ൿ఻ͷόϧΫϝʔϥʔ</h1>

    <form action="do.php" method="post" onsubmit="return confirm('ϗϯτʹૹ৴͠·͢ʁ');"> <p>gmail id</p> <input style="width:100%;" name="gmail_id"/> <p>gmail ΞϓϦύεϫʔυ(GMAILͷΞΧ΢ϯτͷύεϫʔυͰ͸ͳ͍ʂʣ</p> ※ https://myaccount.google.com/security ͔Βઃఆ͢Δ͜ͱ <input style="width:100%;" name="gmail_pass"/> <p>FROM ද໊ࣔ</p> <input style="width:100%;" name="from_name"/> <p>FROM ϝΞυ</p> <input style="width:100%;" name="from_email"/> <p>໊݅</p> <input style="width:100%;" name="subject"/> <p>ຊจ</p> <textarea style="width:100%;height:400px;" name="body"></textarea> <p>ѼઌʢϝΞυվߦ۠੾Γ</p> <textarea style="width:100%;height:400px;" name="mail_list"></textarea> <p> ຊ౰ʹ࣮ߦ͢ΔͳΒɺ͜͜Λonʹ</p> <input type="checkbox" value=1 name="no_dry_run"> <hr> <input type="submit" value="ϝʔϧૹ৴"> </form> </body> </html>
  94. <html lang="ja"> <head> <meta charset="utf-8"> <title>ൿ఻ͷόϧΫϝʔϥʔ</title> </head> <body> <?php date_default_timezone_set('Asia/Tokyo');

    ini_set('display_errors', 1); echo "<pre>"; require_once("vendor/autoload.php"); $gmail_id = $_POST['gmail_id']; $gmail_pass = $_POST['gmail_pass']; $transport = (new Swift_SmtpTransport('smtp.gmail.com', 465, 'ssl')) ->setUsername($gmail_id) ->setPassword($gmail_pass); $mailer = new Swift_Mailer($transport); $subject = $_POST['subject']; echo htmlspecialchars("\n໊݅:\n{$subject}", ENT_QUOTES); $body = $_POST['body']; echo htmlspecialchars("\nຊจ:\n{$body}", ENT_QUOTES); $from_name = $_POST['from_name']; echo htmlspecialchars("\nFROM ໊લ:\n{$from_name}", ENT_QUOTES); $from_email = $_POST['from_email']; echo htmlspecialchars("\nFROM email:\n{$from_email}", ENT_QUOTES); $is_no_dry_run = (isset($_POST['no_dry_run']) && $_POST['no_dry_run']==1) ? true : false ; $mail_list_raw = explode("\n", $_POST['mail_list']); $mail_list = []; foreach($mail_list_raw as $email){ if(!preg_match("/@/", $email)) continue; $mail_list[] = trim($email); } echo htmlspecialchars("\n to addresses :\n", ENT_QUOTES); echo htmlspecialchars(var_dump($mail_list), ENT_QUOTES); echo "<hr>"; $message = new Swift_Message($subject); $message ->setFrom([$from_email => $from_name]) ->setBody($body); foreach($mail_list as $to){ echo htmlspecialchars("{$to}\n", ENT_QUOTES); $message->setTo($to); // Send the message if($is_no_dry_run){ $result = $mailer->send($message); var_dump($result); } } echo "<hr> ऴྃ͠·ͨ͠";
  95. ͏͖͝Ό͍͍ΜͩΑʂ ʢ͍ͩͿͻͲ͍ίʔυͳͷͰখ͍͞ʣ

  96. πʔϧ͸πʔϧ » γΣϧεΫϦϓτʹໟΛੜ΍͢ » ͜͏͍͏πʔϧ͸ʮࠓʯಈ͚͹ྑ͍ɺ όά΍Τϥʔ͸౎౓௚͢ » ʮอकੑΑΓ୯७ੑͩʂʯ ʢ̍೔Ͱ࡞Γ௚ͤͳ͍Α͏ͳΞϓϦͳΒߟ͑Δʣ »

    ͱʹָ͔͘͢Δࣄ͕ॏཁ » ʮॴḨPHPͩ͠ʯ » ʮ͞ΕͲPHPʯ
  97. ͜͏ͯ͠… » ࣗ෼͸͍͢͝ศརͩͱ͓΋͏Μ͚ͩͲɺ୭ʹ΋࢖ΘΕ ͳ͍ϓϩμΫτ͕·ͨੜ·ΕͨͷͰ͋ͬͨ… » ʢಉ༷ͷݸਓϓϩμΫτʹapachehereͱ͔ʣ

  98. ಥવͷએ఻ » builderscon͸ڠྗऀΛ͍ͭ΋ืू͍ͯ͠·͢ʂ » αΠτɺΞϓϦɺ౳ɺࣗ෼ͷझຯΛൃشͰ͖Δʂ » ओʹαΠτ͸pythonͱ͔goͱ͔ͰͰ͖ͯ·͢ » ʮ͑ͬPHP͸ʁʯʮͦͷ࣌๩͔ͬͨ͠Μ΍…ʯ »

    ʢϏϧίϯSlackͷࣗಈট଴ͱ͔͸PHPͰ࡞ͬͨʣ » ஥ؒืूதͰ͢ʂ͋ͳͨ΋JOINʂʂ » ʢ࿩Λ໭͠·͢ʣ
  99. ʮ݁ہWebҎ֎͸ͳ͍ͷʁʯʮ͋Γ ·͢ʯ » https://github.com/php/php-gtk-src » php-gtk » GTK2Λར༻ͨ͠GUIϓϩάϥϛϯά » ʢҎ߱php5.6Ͱࢼ͍ͯ͠·͢ʣ

  100. gtk+ install $ brew install gtk+

  101. cairo install $ wget https://pecl.php.net/get/Cairo-0.3.2.tgz $ cd Cairo $ phpize

    $ make $ make install $ vi path/to/php.ini // add extension=cairo.so
  102. php-gtk install $ git clone https://github.com/php/php-gtk-src $ cd php-gtk-src $./buildconf

    $ ./configure $ make $ make install $ vi path/to/php.ini // add extension=php_gtk2.so
  103. run demo » demosҎԼʹ৭ʑ͋Γ·͢ $ cd demos $ php phpgtk2-demo.php

    2017-08-05 00:47:12.529 php[43302:71455160] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead. » (·͋ͳΜ͔WarnͰ·͚͢Ͳɺݟͳ͔ͬͨ͜ͱʹ͠ ·͠ΐ͏
  104. όόʔϯʂ

  105. None
  106. None
  107. None
  108. ʮLinuxͱ͔ͰΑ͘ΈΔ΍ͭͩʂʯ

  109. class ButtonBox extends GtkWindow { function __construct($parent = null) {

    parent::__construct(); if ($parent) $this->set_screen($parent->get_screen()); else $this->connect_simple('destroy', array('gtk', 'main_quit')); $this->set_title(__CLASS__); $this->set_position(Gtk::WIN_POS_CENTER); $this->set_default_size(-1, 500); $this->set_border_width(8); $this->add($this->__create_box()); $this->show_all(); } /* .... */ if (!@$GLOBALS['framework']) { new ButtonBox(); Gtk::main(); }
  110. function create_framedbox($horizontal, $title, $spacing, $layout) { $frame = new GtkFrame($title);

    if ($horizontal) { $box = new GtkHButtonBox(); } else { $box = new GtkVButtonBox(); } $box->set_border_width(5); $box->set_layout($layout); $box->set_spacing($spacing); $frame->add($box); $button = GtkButton::new_from_stock(Gtk::STOCK_OK); $box->add($button);
  111. ࡉ͔͍આ໌͸লུ͠·͕͢ » GtkWindowΛܧঝͨ͠ΫϥεΛͭ͘Γ » GtkVBoxΫϥεͳͲϨΠΞ΢τΛܾΊΔBOXΛͭ͘ Γ » GtkButtonΫϥε౳ͰϘλϯ౳Λͭͬͯ͘௥Ճ͢Δ » Έ͍ͨͳײ͡Ͱ͢ɺGUIΞϓϦ੡࡞ͰΑ͋͘Δ

  112. ௕ॴ » gtk͸ׂΓͱϝϯς͞Ε͓ͯΓɺେମͷ؀ڥʹ͋Δ » υΩϡϝϯτ͸ʢgtk+ͷ΋ͷ͕ʣ݁ߏ͋Δ » macOSͰ΋͜ͷΑ͏ʹͪΌΜͱಈ͘ » ΢Οδοτͷछྨ΋ଟ͍ͷͰɺ؆୯ͳGUIͳΒϖλϖ λ͸Δ͜ͱͰ࡞ΕΔ

  113. ୹ॴ » gtkͰ͋Δ… » (GTK͕ѱ͍ͱ͸͍͍ͬͯͳ͍͕ʣ » ؀ڥΛ༻ҙ͢Δͷ͕গʑΊΜͲ͏ » (FatpackͳόΠφϦΛ࡞Δʁ) »

    গʑσβΠϯ͕ݹष͍ » CLIͰىಈ͢Δ͜ͱʹͳΓ͕ͪͰʮΞϓϦʯͬΆ͘ͳ ͍
  114. » ࠷ॳ͸؆୯͕ͩɺࢥ͍௨Γʹ͢Δͷ͸೉͍͠… » HTMLΈ͍ͨʹɺίϐϖͰͲ͏ʹ͔ͮ͠Β͍ » PHP7ʹ͸·ͩඇରԠʢϏϧυ͕௨Βͳ͍ʣ

  115. ·͋ɺָ͍͠ͷͰ » PHP͸web͔͠Ͱ͖ͳ͍ͱࢥ͍ͬͯΔ֤Ґ͸ ੋඇҰ౓ͨΊͯ͠Έ͍ͯͩ͘͞ » (͙͢ʹʮHTMLͰॻ͔ͤͯ͘Εʂʯͱ͍͏ײ૝ʹͨ ͲΓண͘ؾ͸͠·͕͢ʣ

  116. ·ͱΊ » PHPͰΞϓϦ͸࡞ΕΔ(ʁ)Ҋ֎؆୯ʂʂ » PHPΛ͞ΘͬͯΔͱPython΋Node.JS΋Electron΋ ৮Δػձ͕͋ͬͯ࠷ߴ(ʁʁʁ) » ͜ͷΑ͏ʹͯ͠PHPΛॻ͖ͭͭϤιͷੈքΛ஌ΕΔ

  117. ͍ͭͰͳͷͰɺ΋͏গ͠ଞͷ෺΋঺հ͠·͢

  118. ༨ஊ » phpdesktop » https://github.com/cztomczak/phpdesktop » nightrainʹ͍͚ۙ͠ͲɺC++౳੡ » (Chrome|IE(!))ʴPHP »

    ͪΌΜͱੜ͖͍ͯ·͢ » (ࠓͷॴ)WindowsͷΈ
  119. Delphi for PHP » https://www.componentsource.co.jp/product/ delphi-for-php-j/about » ʮRADϏδϡΞϧPHP։ൃ؀ڥɻίϯϙʔωϯτʹ ΑΔυϥοάˍυϩοϓ։ൃΛ࣮ݱͨ͠ϏδϡΞϧ౷ ߹։ൃ؀ڥͰ͢ʯ

    » ͕ɺHTML5 Builder ͱ͍͏੡඼ʹϦωʔϜ͞Ε… » ʮHTML5 Builder ੡඼ͷ୯ମൢച͸ऴྃ͞Εɺݱࡏ ͸ RAD Studio ʹ෇ଐ͓ͯ͠Γ·͢ɻʯ » ऴྃ
  120. None
  121. » ʮWebͰ͸ʁʯʮͦ͏ͳΜͩΑͶʯ » ʢ·͋ɺVBͷWebͷΑ͏ͳ΋ͷʣ » ݸਓతʹDelphi޷͖ͩͬͨͷͰ » ʢʮҰମͲ͕͜DelphiͳΜͩ…ʁʯʣ » ·͋ɺͦ͏͍͏΋ͷ͕͋ͬͨɺͱ͍͏࿩Ͱ͢ɻ

  122. wxphp » wxPHP (wxWidgets for PHP) » https://wxphp.org/ » ࿝ฮͷwxWidgetͷόΠϯυ

    » https://wxphp.org/applications ࣮ྫ΋৭ʑ͋Δͧ
  123. None
  124. wxphpͷҰྫͱͯ͠ » https://github.com/AndrewRose/Grease » PHP editor written in PHP with

    remote debugger and plugin API. » ͳΜͱPHPͰͰ͖ͨ౷߹։ൃ؀ڥͰ͋Δ
  125. None
  126. ʮ݁ߏ͢͝ͳ͍ʁʯ

  127. » ʮٱʑʹ͞ΘͬͯΈΔ͔ʙʯ » ΦϑΟγϟϧϏϧυͨΊͨ͠Βηά͓ͬͯͪͨˠ » ʮ͔ͨ͠ͳ͍wxphpͼΔͲ͠ΐ…ʯˠ » ͔͠͠BrewͷwxmacͰ͸μϝˠ » ʮ͔ͨ͠ͳ͍ɺwxwidgetϏϧυ͠Α…ʯˠ

    » ʮهԱͲ͓ΓΊͪΌͪ͘Ό͔͔࣌ؒΔͳ…ʯˠ » Ϗϧυίέͨ… →
  128. ׬ (௅ઓऀٻΉ)

  129. PHP/Tk » http://php-tk.sourceforge.net/ » ΈΜͳ͝ଘ஌ςΟΫϧςΟέʔͷςΟʔέʔ » ʮTk͞ΘΔͷPerl/TkҎདྷͩͳʙʯ » 2004೥…12೥લ͔… »

    …Ϗϧυ͕௨Δؾ͕͠ͳ͍…
  130. » php5.6Ͱ͸Ϗϧυ͕ίέͨ… » php5.3Ͱ͸Ϗϧυ͕௨ͬͨʂ » ͍͚Δ͔ʂʁ

  131. None
  132. Fatal error: Allowed memory size of 134217728 bytes exhausted (tried

    to allocate 18446744073709551396 bytes ) in /tmp/phptk/tk-0.1.1/test.php on line 4 Segmentation fault: 11
  133. − 18446744073709551396 bytes − ʮ໰୊Ͱ͢ɺ͜Ε͸ԿόΠτ͔ʁʯ

  134. ׬ » 18ΤΫαόΠτͷϝϞϦ͸༻ҙͰ͖ͳ͔ͬͨΑ…

  135. SDL2 » https://github.com/Ponup/phpsdl » PHP5.6 ϏϧυͰίέʢry » ͱ͓΋ͬͨΒɺPHP7Ͱ௨Δ » ͱ͓΋ͬͨΒɺ

    PHP Startup: SDL: Unable to initialize module » ׬ʢ͋ͬɺ΋͏͍͍Ͱ͔͢ʁʣ
  136. Ͳ͏Ͱ͔͢ » օ͞Μ͍͖͍͍ͭͯͯͨͩͯ·͢Ͱ͠ΐ͏͔ʁ » ͋Μ·Γਓؾͷͳ͍PHPͷC֦ு͸macOS(OSX)ͩ ͱಛʹյΕ͍͖ͯ·͢ʢೆແʣ » ʢLinux΍Windowsͩͱಈ͘ࣄ΋ʮଟ͍ʯͰ͢Αʣ » ·͋ɺࢲ΋झຯ͔ͩΒ͍͍ΜͰ͚͢ͲͶʙʙ…

    » ΋͏਺೥͢Ε͹ϝϯς͞ΕΔͷͰ͸ʢئ๬ʣ » ʢҰ෦ͷํ΁ɿࠓճͷʮҋʯͰͨ͠ʣ
  137. ͜͜·ͰͰ࣭໰͋Γ·͢ʁ

  138. ୈnू ύέοτΩϟϓνϟ ͜͜·Ͱ೉͍͠ࣄ͕͍ͭͮͨͷͰɺΈΜͳຖ೔΍͍ͬͯ ΔύέοτΩϟϓνϟʹ͠·͠ΐ͏ɻ օ͞ΜύέοτΩϟϓνϟͯ͠·͢ʁύέοτݟͯ· ͢ʁ

  139. pcapϥΠϒϥϦ͕৭ʑ͋Γ·͢ » packetΛѻ͏ͳΒ΍ͬͺΓlibpcap » ࠓճ͸ͪ͜ΒͷϥΠϒϥϦΛར༻ » https://github.com/metashock/php-pcap » C֦ுͰ͢ »

    ʮPHPͷC֦ுͬͯΠϯετʔϧ໘౗͡Όͳ͍ʁʯ ʮͦΜͳͨ͜ʔͳ͍ʯ
  140. Πϯετʔϧ͸ʮΧɾϯɾλɾϯʯ $ git clone git@github.com:metashock/php-pcap.git $ cd php-pcap $ phpize

    $ configure $ make $ make install
  141. $ make install Installing shared extensions: /Users/uzulla/.phpenv/versions/5.6.30/ lib/php/extensions/no-debug-non-zts-20131226/ // ੜ੒͞Εͨpcap.soͷ৔ॴΛ͔֬ΊΔ

    $ ls /Users/uzulla/.phpenv/versions/5.6.30/ lib/php/extensions/no-debug-non-zts-20131226/ pcap.so
  142. vi /path/to/php.ini ઌఔͷPathΛ௥ه extension=/Users/uzulla/.phpenv/versions/ 5.6.30/lib/php/extensions/no-debug-non- zts-20131226/pcap.so

  143. $ php -i |grep pcap pcap pcap support => enabled

  144. <?php $pcap = pcap_open_live( "lo0", // ϧʔϓόοΫσόΠε 65535, // len

    1, //promiscuous mode 10000, // ଴ͪड͚Δmsɺ௒͑ͨΒऴྃ $errbuf); $i = 0; while(($data = pcap_next($pcap, $header)) && $i++ < 50) { echo $data; } $ret = pcap_close($pcap);
  145. ϩʔΧϧhttpd΁ͷΞΫηεͰ͜ͷΑ͏ͳग़ྗΛಘΒΕͨ E���@@�!���7^y���1��v l�ll�lGET / HTTP/1.1 Host: 127.0.0.1:8080 User-Agent: curl/7.51.0 Accept:

    */*
  146. ͳΜ͔ΰϛ͕͋Γ·͢Ͷɺ HEXDUMPͯ͠Έ·͠ΐ͏ while(($data = pcap_next($pcap, $header)) && $i++ < 50)

    { hexdump ( $data, 0 ); } » ʢhexdumpؔ਺͸ͪ͜ΒΑΓ http:// www.aidanlister.com/2004/04/viewing-binary- data-as-a-hexdump-in-php/ʣ
  147. -------------------------------------------------------------------------------- 0000 02 00 00 00 45 00 00 82

    79 b5 40 00 40 06 00 00 ....E..� y�@.@... 0010 7f 00 00 01 7f 00 00 01 f5 19 1f 90 51 8d 0a 80 ...... �..�Q�.� 0020 f7 f0 63 c5 80 18 31 d7 fe 76 00 00 01 01 08 0a ��cŀ.1� �v...... 0030 12 6f 3f 63 12 6f 3f 63 47 45 54 20 2f 20 48 54 .o?c.o?c GET / HT 0040 54 50 2f 31 2e 31 0d 0a 48 6f 73 74 3a 20 31 32 TP/1.1.. Host: 12 0050 37 2e 30 2e 30 2e 31 3a 38 30 38 30 0d 0a 55 73 7.0.0.1: 8080..Us 0060 65 72 2d 41 67 65 6e 74 3a 20 63 75 72 6c 2f 37 er-Agent : curl/7 0070 2e 35 31 2e 30 0d 0a 41 63 63 65 70 74 3a 20 2a .51.0..A ccept: * 0080 2f 2a 0d 0a 0d 0a /*....
  148. ύοͱݟ্ͯҐ56byte͕ϔομʔͬΆ͍Ͱ͢Ͷʂ ʢ·͋͜ͷ৔ʹ͍Δօ͞Μ͸ৗࣝͰ͢ΑͶʂʣ substrͰ ࡟ͬͯΈ·͠ΐ͏ʂ (PHPͷsubstr͸όΠτૢ࡞ʹ࢖͑·͢)

  149. while(($data = pcap_next($pcap, $header)) && $i++ < 50) { echo

    substr(56, $data); } » (substr͸όΠτྻૢ࡞ʹ΋͔ͭ͑·͢ʣ
  150. GET / HTTP/1.1 Host: 127.0.0.1:8080 User-Agent: curl/7.51.0 Accept: */* HTTP/1.1

    404 Not Found Host: 127.0.0.1:8080 Date: Fri, 28 Jul 2017 10:49:57 +0000 Connection: close Content-Type: text/html; charset=UTF-8 Content-Length: 533 <!doctype html><html><head><title>404 Not Found</title> <style> <SNIP> </style> </head><body> <h1>Not Found</h1> <p>The requested resource <code class="url">/</code> was not found on this server.</p></body></html>
  151. ΍Γ·ͨ͠Ͷʂ͍͍ײ͡Ͱ͢ʂ » ΈΜͳ͍͖ͩ͢ͳPHPͰ΋Ͱָ͖͍ͯ͠ » ͋ͱ͸packͱ͔unpackͱ͔͔ͭͬͯઌ಄56όΠτ Λ͍ͬͯ͡ΈͨΓ » (࢒೦ͳ͕ΒɺPHPͰߏ଄ମΛѻ͏ͷ͸໘౗) » ΈΜͳ͕஌ͬͯΔύέοτΛ৭ʑ͍͡Δͱͨͷͦ͠͏

    Ͱ͢Ͷʂ » PHPͰ΋ύέοτΛ৮ΕΔʂ
  152. PHPͰύέοτΛ৮ΔϝϦοτ » ಛʹແ͍ʂ » จࣈྻૢ࡞͸ಘҙ͕ͩɺόΠφϦૢ࡞͸͞΄ͲͰ΋ ͳ͍ʢͰ͖ͳ͘͸ͳ͍ʣ » ͱ͸͍͑CΑΓෑډ͸௿͍ʢʁʣ͠ɺ΍ͬͨ͜ͱ͕ͳ ͍ਓ͸΍Ζ͏ʂ

  153. ༨ஊɺC֦ுʹ͍ͭͯ » peclҎ֎ʹ΋C֦ு͸͋Δ » phpͷC֦ுΛೖΕΔͷ͸݁ߏ؆୯ » php5ҎԼͰ͔͠ಈ͔ͳ͍֦ு΋ଟ͍ » ϒϥϯν΍ISSUEΛΈͯΈΑ͏ »

    ͳ͚Ε͹phpenvͰ͖Γ͔͑ͯ࢖͍·͠ΐ͏(લ޲ ͖
  154. ͦͷଞ » https://github.com/marcelog/SimplePcap » https://github.com/zobo/php-pcap » https://github.com/Grisou13/pcap-php

  155. ͸͍

  156. ୈπू IoT ిࢠ޻࡞ ͍ΘΏΔϥζύΠͰ͕͢…PHPͰ΋໪࿦ϥζύΠ͸࢖͑ ·͢ɺ͍ͬͯ͏͔݁ߏ͍͍ײ͡Ͱ͢ɻ PHPͷҙຯʁ͍΍PHPͰ͋Δ͔Βҙຯ͕͋ΔΜͰ͢Α͜ Ε͸ɻ(ࢲʹͱͬͯ͸ɺͰ͕͢)

  157. ͳʹΛ΍Δ΂͖͔ » LνΧͱ͔໘ന͘ͳ͍ » ࣸਅ޷͖ͩ͠ɺPHPͰσδΧϝΛͭ͘Ζ͏ʂ » ΩϟϓνϟˍTweet

  158. None
  159. None
  160. None
  161. ʮͪΐͬͱͨ͠ෆ৹෺ͩͳ…ʯ

  162. σϞ

  163. rasberry pi zero w » ௒খܗͰ҆ͯ͘(ˇ1400)Wifi༗ » PHP(7.1)΋ͪΌΜͱಈ͖·͢ » MacͱʮUSBέʔϒϧҰຊͰʯిݯͱsshͰ͖ͯϚδ

    खܰ » ʢUSB NICΈ͍ͨͳʣ » ʢWifiઃఆίέΔͱ྆ํࢮ͵ͷͲ͏ʹ͔ͳΒΜͷ ͔ʣ
  164. None
  165. RaspiͷΧϝϥ » ΧϝϥϞδϡʔϧ 4000ԁ ͘Β͍ » ؆୯઀ଓɺ΅ͪ΅ͪը࣭΋ ྑ͍ » zero༻ϑϨΩέʔϒϧ͸

    1000ԁ͘Β͍
  166. γϟολʔϘλϯ » ΧϝϥͳΒγϟολʔϘλ ϯ͕͍Δͳ » ϒϨουϘʔυͰͭͳ͗· ͘Δͷָ͍͚͠Ͳ໘౗ » Ϙλϯͻͱͭͷҝʹ Joy

    bonnetΛങͬͨ (ˇ2000) » https:// www.adafruit.com/ product/3464
  167. ૊Έཱͯ » Raspi͸Ұੲ·͑ͷࣗ࡞PCͬΆ͍ » ૊ΈཱͯΔ͚ͩͰOK » GPIOͷpin͚ͩҰखؒ

  168. GPIOͷpin » ͸Μͩ෇͚ or ѹೖ » ී௨ʹ͸Μͩ෇͚͕ྑ͍ » ѹೖʢϋϯϚʔʣऔΓ෇͚͓͢͢Ί͠ͳ͍ »

    ج൫ΛΨϯΨϯϋϯϚʔͰୟ͘ͷ͸ͦΕͳΓʹ୾ ྗ͕͍Δ » Ψλ͍ͭͨͷͰ݁ہ͸Μͩ෇͚ͨ͠ʢʣ
  169. ͦͷଞઃఆ » OSΛSDΧʔυʹ͍Εͯ » sshΛ༗ޮʹͯ͠ » Wifiͱ͔ͷઃఆͯ͠ » Χϝϥͱ͔༗ޮʹͯ͠ »

    PHP7.1Λ໺ྑrepo͔Β͍Εͯ » joy bonnetͷઃఆͯ͠ » ४උ׬ྃ
  170. ࠓճͷར༻ϥΠϒϥϦ » Ωϟϓνϟ » https://github.com/cvuorinen/raspicam- php » GPIOಡΈग़͠ » https://github.com/PiPHP/GPIO

    » ʢґଘ͕̑̏΋͋ͬͯҟৗʣ » Tweet » https://github.com/abraham/twitteroauth
  171. <?php // Ϙλϯ͕ԡ͞Ε͔ͨ؂ࢹ͢Δίʔυ require "vendor/autoload.php"; use PiPHP\GPIO\GPIO; use PiPHP\GPIO\Pin\InputPinInterface; $gpio

    = new GPIO(); $pin = $gpio->getInputPin(12); $pin->setEdge(InputPinInterface::EDGE_BOTH); $interruptWatcher = $gpio->createWatcher(); $interruptWatcher->register($pin, function (InputPinInterface $pin, $value) { if($value == 0){ echo "PUSHED!" } return true; }); while ($interruptWatcher->watch(5000))
  172. <?php // ࡱӨ͢Δίʔυ require "vendor/autoload.php"; use Cvuorinen\Raspicam\Raspistill; $camera = new

    Raspistill(); $camera->takePicture('pic.jpg');
  173. <?php // πΠʔτ͢Δίʔυ require "vendor/autoload.php"; use Abraham\TwitterOAuth\TwitterOAuth; include_once "config.php"; $connection

    = new TwitterOAuth( CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET); $media1 = $connection->upload('media/upload', ['media' => 'img.png']); $parameters = [ 'status' => 'πΠʔτςΩετ #builderscon', 'media_ids' => implode(',', [$media1->media_id_string]) ]; $result = $connection->post('statuses/update', $parameters);
  174. <?php //શ෦૊Έ߹ΘͤͨΒ͜͏ͳΔ require "vendor/autoload.php"; include_once "config.php"; use Cvuorinen\Raspicam\Raspistill; use Abraham\TwitterOAuth\TwitterOAuth;

    use PiPHP\GPIO\GPIO; use PiPHP\GPIO\Pin\InputPinInterface; $gpio = new GPIO(); $pin = $gpio->getInputPin(12); // a button $pin->setEdge(InputPinInterface::EDGE_BOTH); $interruptWatcher = $gpio->createWatcher(); $interruptWatcher->register($pin, function (InputPinInterface $pin, $value) { if($value != 0){ return true; } $camera = new Raspistill(); $camera->width(1024)->height(768)->takePicture('pic.jpg'); $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET); $media1 = $connection->upload('media/upload', ['media' => 'pic.jpg']); $parameters = [ 'status' => '#builderscon', 'media_ids' => implode(',', [$media1->media_id_string]) ]; $result = $connection->post('statuses/update', $parameters); }); while ($interruptWatcher->watch(5000)){}
  175. ͋ͱ͸ɺىಈ࣌ʹىಈ͢ΔΑ͏ʹ͢Δ͚ͩ ### systemd [Unit] Description=TweetCamera After=syslog.target [Service] Type=simple WorkingDirectory=/home/pi/phpapp ExecStart=/usr/bin/php

    /home/pi/phpapp/gpioandshootandpost.php TimeoutStopSec=5 StandardOutput=null [Install] WantedBy = multi-user.target
  176. $ sudo systemctl start tweetcamera $ sudo systemctl enable tweetcamera

    » ͜ΕͰిݯܨ͍ͩΒϓϩάϥϜ͕૸Δ
  177. Ͱ͖ͨʂ » ͚͋ͬͳ͍΄Ͳ؆୯ʂʂʂ » ·͋ɺϥζύΠͩ͠Ͷ » ͕͢͞PHPʂʂ

  178. ͳͥɺPHPͳͷ͔ʁ » ʮPHP͔ͩΒɺଞʹཧ༝͕͍Δͷ͔ʁʯ » Raspi͸ߴੑೳͳͷͰɺͦΕͳΓʹPHPಈ͘ » PCͰେମॻ͍͍͚ͯ࣋ͬͯΔ » PHP͸େମͷ͜ͱ͕Ͱ͖ΔɺϥΠϒϥϦ͕๛෋ »

    ʮ؅ཧը໘ʯΛੜ΍͠΍͍͢
  179. ·ͱΊ » PHPʴRaspi͸ָͰָ͍͠ɺे෼࢖͑Δ » rasberrypi zero w͸ಛʹ͍҆͠ɺͨͷ͍͠ » PHPerͰ΋ຊ౰ʹ؆୯ʹ৭ʑͰ͖ͯ࠷ߴ »

    ʮຊ෺ͷʯPHPͳͷͰɺը૾ม׵ͱ͔΋Ͱ͖·͢ » ʢॳ৺ऀͷLinux+PHP؀ڥͱͯ͠΋खܰͰ͍͍ͷ͔ ΋͠Εͳ͍ʣ
  180. ͸͍ » ͜͜·ͰͰ࣭໰͋Γ·͢ʁ

  181. ୈ!ू σʔϞϯ PHPer͕͓ͳ͡ΈͷσʔϞϯͱ͍͑͹ʁ FTPͰ͢ΑͶʂ

  182. ftpd » PHPͰ͔͔Εͨftp server » https://github.com/lukas2511/PHP-FTP-Server » ͏Μɺ͏͔͝ͳ͔̓(ry » օ༷ʮ·͔ͨΑʂʯ

    » (௚ͤ͹ಈͬ͘Ά͍͚Ͳɺ͕࣌ؒͳ͔ͬͨͷͰεΩο ϓ)
  183. (ؾΛऔΓ௚ͯ͠) sshd » ଞʹ΋SSH͘Β͍͸͓ͳ͡ΈͰ͢ΑͶ » https://github.com/fpoirotte/pssht » sshͰ઀ଓͯ͠ɺςΩετσʔλ΍ΓऔΓ͕Ͱ͖Δ

  184. » git cloneͯ͠ » composer installͯ͠ » php bin/pssht »

    ssh -T -p 22222 your_id@localhost » 伴ೝূ͋Δ͍͸ύεϫʔυpssht
  185. » σϑΥϧτͰ͸Τίʔαʔόʔ » (͕࣌ؒ͋·ͬͯΕ͹σϞ)

  186. None
  187. मਖ਼ͯ͠Έ·͠ΐ͏

  188. // src/Application/EchoService.php public function handle( <SNIP> ) { $message =

    \fpoirotte\Pssht\Messages\CHANNEL\DATA::unserialize($decoder); $channel = $message->getChannel(); $ೖྗ͞Εͨจࣈྻ = $message->getData(); $ૹ৴͍ͨ͠จࣈྻ = "޷͖ʹͨ͠ΒΑ͍"; $response = new \fpoirotte\Pssht\Messages\CHANNEL\DATA($channel, $ૹ৴͍ͨ͠จࣈྻ); $transport->writeMessage($response); return true; }
  189. None
  190. » ʮҙຯ͋Δͷ͔ʁʯʮίϚϯυૹͬͨΓͱ͔৭ʑ͋ Δ΍Ζʯ » ʮΑ͘Θ͔Βͳ͍ʯʮ͜Ε͔ͩΒ΢Σϒ࣌୅ͷਓؒ ͸…(Զ΋ͦ͏ࢥ͍·͢ʯ » Webͱ͕ͪͬͯ伴ೝূͰ͖Δͷ͸ศརͩͱࢥ͏…(ଟ ෼) »

    ͱʹ͔͘ເ͕͋ΔͩΖʂ
  191. ͦͷଞͷσʔϞϯ » (WebҎ֎Ͱ…ʁ)

  192. smtpd΍imap » smtpd΋͋Γ·͢ʢ͓࣌ؒͳ͍ͷͰলུʣ » https://github.com/TwixtedChaox/Guerrilla- SMTPd » https://github.com/TheFox/smtpd » ໪࿦ʢʁʣIMAP΋

    » https://github.com/TheFox/imapd
  193. PocketMine-MP » MineCraft PocketEditionͷαʔόʔ » https://github.com/pmmp/PocketMine-MP » A highly customisable,

    open source server software for Minecraft: Pocket Edition written in PHP » (ଞʹ΋ɺiTXTech/Genisysͱ͔͋Δʣ
  194. UltimaPHP » Ultima Online ͷOpensourceαʔόʔ » https://github.com/joaoescribano/UltimaPHP » UltimaPHP is

    a modern Ultima Online server written in PHP 7.0 » ʢ͔ͭͬͨ͜ͱ͸ͳ͍ʣ
  195. ॴͰɺͲ͏΍ͬͯσʔϞϯʹʁ » PHPͷCLIΞϓϦΛͲ͏΍ͬͯৗ࣌ىಈ͢Δ͔ʁ » ࠓ͸systemdΛ࢖͏ͱྑ͍Ͱ͠ΐ͏ » (αϯϓϧ͸લड़͠·ͨ͠Ͷ) » ʮrc.localͱnohup͕ջ͔͍͠Ͱ͟͝Δʯ »

    daemontools΍supervisord͸΋͏ෆཁ(ʁ) » ָͳͷ͸screenͰσλονͰ͚͢ͲͶ͆
  196. ͸͍

  197. ୈ൪֎ฤ ͓΋͠ΖPHPΛ஌Δʹ͸ʁ » GithubΛDigΔ » ṖͷBotΛϑΥϩʔͯ͠શ෦ݟΔʢແཧͰ͢ʣ https://twitter.com/call_user_func » redditɺHackerNewsɺϝϧϚΨͳͲ »

    ւ֎͸݁ߏ͋Δ » ڞ࢈ݍ͸݁ߏ໘ന͍(ಡΊͳ͍͚Ͳ) » ͳʹΑΓ΋৘೤ͱ࣌ؒʢʣ
  198. ͓΋͠ΖPHPΛ஌Δͷʹඞཁͳಓ۩ » PHPStorm(ίʔυδϟϯϓ͍ͨ͠) » ag(ίʔυݕࡧ͍ͨ͠),tig(blame͍ͨ͠) » GithubͰಡΉͷ͸େม » phpenvʢ͋ΒΏΔόʔδϣϯ͕ඞཁʣ »

    VM(macOSͰಈ͔ͳ͍෺༻) » ߴ଎ͳPCʢϏϧυͷࢼߦࡨޡʢʣʣ » InternetArchiveʢফ͑ΔͷͰ…ʣ
  199. ࠷ऴճ ·ͱΊ » PHP͸΢ΣϒҎ֎΋ָ͠ΊΔ » ָ͠Έ·͠ΐ͏! » ʮͳΜͰPHPʁʯͱ͍͏എಙײ΋ָ͍͠ » େମʮૉ๿ʯͳͷͰɺಡΊͯษڧʹͳΔʢʁʣ

    » PHPͷؾ͕ܰ͞࠶ൃش͞ΕΔؾ͕͢Δ » ʢࡢࠓͷWeb͸গʑଉ͍ۤ͠ͷͰʣ
  200. » PHP͸ੲͱมΘΒͣ༡΂Δ » PHPͷؾ͕ܰ͞׆͔ͤΔ৔͸·ͩ͋Δ » ͦΕ͕ࠓճ͓఻͍͑ͨ͠ࣄͰͨ͠

  201. ఏڙ Ώ͔ͨͳ໌೔Λங͘ PHP Ͱ͓ૹΓ͠·ͨ͠ (Կ͔࣭໰͸͍͟͝·͔͢ʁ)

  202. ੋඇ౤ථΛ͓ئ͍க͠·͢ʂ » ͳ͓ɺ౤ථγεςϜ͸PHP੡Ͱ͢ʢ͔ͩΒʁ͆ʣ

  203. ୈϘπू औΓ্͛ΒΕͳ͔ͬͨ෺ͨͪ » ݸਓతʹ໘ന͍Μ͚ͩͲ͕࣌ؒͨΓͳ͔ͬͨ΋ͷͨ ͪͰ͢

  204. babel-preset-php » https://gitlab.com/kornelski/babel-preset-php » PHP > JSτϥϯεύΠϧ » ࠷ۙͷ࿩ͳΜͰɺ͋Μ·Γҋ౓͕ͳ͍(?) (ײ֮ͷຑᙺ)

    » ݁ߏΑ͘Ͱ͖ͯͯϏϏΔ » ʮTSͱ͔Ͱ͍͍͡Όͳ͍ʁʯʮpreg_*ͱ͔΋͋ΔΜ ͩΑʯ
  205. gameboy Τϛϡ » https://github.com/gabrielrcouto/php- terminal-gameboy-emulator » CLIͰήʔϜϘʔΠ » աڈ@tomzoh͞Μ͕࿩ͨ͠ͷͰলུ »

    https://speakerdeck.com/tomzoh/zhu-jun-si- hagemuboigada-hao-kida-php-and-gemuboi
  206. c64php » ίϞυʔϧ64Τϛϡ » https://github.com/jaytaph/c64php » GUI͸PHPͰ͸ͳ͘ɺPythonʢGTKʣ

  207. PHP-ML » https://github.com/php-ai/php-ml » ʮػցֶशͳʹͦΕ͏·͍ͷʁʯ

  208. phpopengl » https://github.com/Ponup/phpopengl » openGL

  209. νϡʔϦϯάϚγϯͱ͔ϥΠϑήʔϜͱ͔ » https://github.com/igorw/turing-php » https://github.com/igorw/conway-php

  210. ೉ಡԽʢεΫϥϯϒϧʣ » phpίʔυ͸ฏจͰ͕͢ɺಡΊͳ͍ͨ͘͠ͱ͍͏ध ཁ͸͠͹͠͹͋Γ·͢ » ionCube Encoder » http://www.ioncube.com/ »

    zend Guard » http://www.zend.com/en/products/zend-guard » php beast » https://github.com/liexusong/php-beast
  211. DraftCode » εϚϗͱ͔Ͱ΋PHP͸ಈ͘ » iOS(iPhone,iPad) » PHP5.6 » sqliteαϙʔτ

  212. ๛෋ͳ͓·͚ » Wordpress » (Sqliteಈ࡞༻ʹௐ੔) » phpLiteAdmin » phpMyAdmin

  213. » ͳʹ͕Α͍ͬͯɺεϚϗͰ΋HTMLͰ؆୯ʹը໘͕࡞ ΕΔ » ʮWebͰ͸ʁʯʮγʔοʂʯ » PHP͸࣌ͱ৔߹ʹΑͬͯ͸ͼͬ͘Γ͢Δ΄Ͳศར » ؔ਺͕΄ͱΜͲ૊ΈࠐΈͳͷͰ؆୯ͳࣄͳΒϥΠϒ ϥϦ͕͍Βͳ͍

    » ؆୯ͳ࡞ۀͳΒଞͷݴޠͷXഒͷੜ࢈ੑ
  214. » ʮ͍·͙͋͢Δจࣈྻͷsha1͕ཉ͍͠ʯ » ग़ઌ͕ͩɺࠓJSON APIΛίʔϧ͍ͨ͠ » ࠓ͙͢ෳࡶͳจࣈྻஔ׵Λ͍ͨ͠ » εϚϗ؀ڥͳΒผʹηΩϡϦςΟ͍ΒΜ΍Ζ(ʁ) »

    ແ࿦file_get_contentsͱ͔΋࢖͑·͢
  215. ௕ॴ » ඈߦػ΍ిंͷதɺͲ͏Ͱ΋͍͍࣌ʹٔΕΔͷʹͽ ͬͨΓ » PHPerಉ࢜Ͱʮ͋ͷؔ਺ͷڍಈͳΜ͚ͩͬʁʯͱ͍ ͏࿩୊ΛҰൃղܾ » (5.6͚ͩͲ…ʣ »

    icloudɺDropboxɺGoogle Drive౳͔ΒσʔλΛͻ ͬͺΕ·͢(ྑ͍ » zipʹ͔ͨΊͯ·ͱΊͯ΍ΓऔΓ
  216. ܽ఺ » ݁ߏߴ͍(1300ԁ) » ͍·ͩPHP5.6 » ಠࣗͷ֦ு͕ߦΘΕ͍ͯΔ » ಺෦తʹʮγΣϧʯ͕ͳ͍ »

    Composer͕؆୯ʹ͸͏͔͝ͳ͍ » iOS͔ͩΒ͔ͨ͠ͳ͍Ͷ
  217. » ΤσΟλ͕͠ΐ΅͍ » ίʔυॻ͘ΞϓϦͳͷʹɺ ͍·Ͳ͖ΩʔϘʔυ͕OS ඪ४ͷ΍ͭͱ͔…

  218. Ͱ͸ࢲ͸Կʹ͔͍ͭͬͯΔͷ͔ʁ » ߴػೳͳి୎Ͱ͢ʢʣ

  219. ͓·͚ͱ͍͏໊ͷऄ଍ PHP7.2ͷ࿩ » RFCΛΈΔͱ͍͍ͩͨΘ͔Δ » https://wiki.php.net/rfc#phpnext72

  220. Trailing commas in list syntax $a = [ 1, 2,

    3, // લ͔ΒOK ]; myFunc( 1, 2, 3, // ͨͱ͑͹͜͏͍͏ͷΛOKʹ ) » Ұ෦͸௨Γͦ͏
  221. Deprecate and Remove Bareword (Unquoted) Strings $a = bare_word; echo

    $a; // -> bare_word // notice͸ͰΔ͚Ͳɺ͏͍ͯ͝͠·͏ » "falsu"Έ͍ͨͳͷΛආ͚Δҝ » ॱ౰Ͱ͸
  222. Debugging PDO Prepared Statement Emulation $stmt = $db->prepare('SELECT :string'); $stmt->bindValue(':string',

    'foo'); // returns unparsed query before execution var_dump($stmt->activeQueryString()); // => string(14) "SELECT :string" // returns parsed query after execution $stmt->execute(); var_dump($stmt->activeQueryString()); // => string(11) "SELECT 'foo'" » ੜ੒͞ΕΔSQL͕ݟΕΔ » ॿ͔Δ
  223. Debugging PDO Prepared Statement Emulation v2 $sth = $dbh->prepare('SELECT name,

    colour, calories FROM fruit WHERE calories < ? AND colour = ?'); $sth->bindParam(1, $calories, PDO::PARAM_INT); $sth->bindValue(2, $colour, PDO::PARAM_STR); $sth->execute(); $sth->debugDumpParams(); Output: SQL: [82] SELECT name, colour, calories FROM fruit WHERE calories < ? AND colour = ? Sent SQL: [88] SELECT name, colour, calories FROM fruit WHERE calories < 150 AND colour = 'red' Params: 2 Key: Position #0: paramno=0 name=[0] "" is_param=1 param_type=1 Key: Position #1: paramno=1 name=[0] "" is_param=1 param_type=2 ΋ͬͱ͔ͨ͢Δ
  224. Object typehint function myFunc(array $a, object $b){ } » arrayͱ͔͕͋ͬͯobject͕ͳ͔ͬͨͷͰ͔ͨ͢Δ

    (ʁ) » (ී௨ʹͪΌΜͱΫϥε໊ॻ͚͹ྑ͍ͷͰ͸…)
  225. » ͱ͍͏ͷ͕ɺ(ݸਓతʹӨڹ͕͋Γͦ͏ͳ)৽ػೳͰ͢ » ଞ͸ඍົͳॻ͖ํΛඇਪ঑ʹͱ͔ͦ͏͍͏ͷ͕ଟ͍ » ͑ͬɺ଎౓Ͱ͔͢ʁ

  226. more faster » http://www.phoronix.com/scan.php? page=news_item&px=PHP-7.2-Beta-1

  227. » betaͷ࣌఺Ͱ5ʙ10%͘Β͍଎͘ͳ͍ͬͯΔ » 7.0->7.1ΑΓ΋ੑೳ޲্෯͸େ͖͍ » ଟ͘ͷLLΑΓ͸͢Ͱʹ଎͍(ཁग़య)

  228. » (ະདྷͷ࿩͕ͩ) PHP8Ͱ͸JIT͕࣮૷͞ΕΔ༧ఆ » https://www.phpclasses.org/blog/post/493- php-performance-evolution.html (2017-04-10) » ·ɺݴޠͷॲཧ଎౓ͳΜͯͦΜͳҙຯͳ͍͚ͲͶʂ()

  229. » PHP 7.2͸7.1ಉ༷ʹਖ਼ৗਐԽ » 2017೥຤ʙࠒʹϦϦʔε༧ఆ » PHP͸2όʔδϣϯલ͘Β͍·Ͱαϙʔτ » ʢ5.6͸2018຤·ͰEOL͕৳ͼ͚ͨͲʣ »

    Ճ଎͍ͯ͠·͢ͷͰؤுΓ·͠ΐ͏ » ʢͱ͸͍͑ɺ࠷ۙͦ͜·Ͱ͠ΜͲ͘͸ͳ͍ʣ
  230. PHPདྷͯΔͰ…ʢPHPerஊʣ » ܕʢܕͰ͸ͳ͍ʣ΋ීٴ࢝·ͬͯΔ͠ » 7.1,7.2Ͱߋʹ଎͘ͳͬͨ͠ » ʢ·͋ɺҟ࿦͸͓࣋ͪؼΓ͍ͩ͆͘͞ʣ » WindowsͷPHP͕΋͏ͪΐͬͱͲ͏ʹ͔… »

    Windowsʹ΋ඪ४ͰೖͬͨΓ͠ͳ͍͔ͳ(BoWͰ) » ֤OSͷඪ४PHP΋ͬͱόʔδϣϯ্͕ͬͯ΄͍͠
  231. EOL see you next conference!!