Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PHPでGUIアプリを作れなかった(pecl編)
Search
chiroruxx
September 02, 2023
0
440
PHPでGUIアプリを作れなかった(pecl編)
第155回PHP勉強会@東京で発表したスライドです。
chiroruxx
September 02, 2023
Tweet
Share
More Decks by chiroruxx
See All by chiroruxx
PHPをGoで動かす
chiroruxx
0
66
Goを使ってTDDを体験しよう!
chiroruxx
1
690
今ならできる!PhpStormプラグイン開発
chiroruxx
0
60
Go Connectへの想い
chiroruxx
0
190
eBPF with PHPをさわる
chiroruxx
0
140
sl完全に理解したつもり
chiroruxx
0
130
命名をリントする
chiroruxx
1
890
良い命名かを調べるリンターを作った + α
chiroruxx
0
130
GoLandを布教する会
chiroruxx
0
47
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Making Projects Easy
brettharned
120
6.5k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Code Review Best Practice
trishagee
73
19k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
69k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Producing Creativity
orderedlist
PRO
348
40k
Transcript
1)1Ͱ(6*ΞϓϦΛ ࡞Εͳ͔ͬͨ QFDMฤ 第155回 PHP勉強会@東京
ࣗݾհ ▪ ちひろ ▪ Twitter: @chiroruxxxx ▪ 会社: 株式会社モリサワ
/BUJWF1)1͕Ͱ͢Ͷʂ https://nativephp.com/
/BUJWF1)1 ▪ PHP で GUI アプリを作るための Laravel プラグイン – Electron
などなどで実現 – route で指定した内容を表示する (WebView のようなイメージ) ▪ ついに PHP で GUI アプリを作れるようになった! ▪ PHP にとって GUI 元年になるかもしれない! Window::open() ->route('top');
(6*ݩɾɾɾʁ🤔
1)1ͬͯલ͔Β (6*࡞Ε·͢ΑͶ ͬͨ͜ͱͳ͍͚Ͳ
https://www.php.net/manual/ja/refs.ui.php
6*Ϟδϡʔϧ ▪ PHP7 以上 ▪ Pecl 拡張モジュール ▪ Windows /
Mac / Linux で動く ▪ libui を入れておく必要がある
Πϯετʔϧ # install meson pip3 install --user meson # install
ninja brew install ninja # install libui git clone
[email protected]
:andlabs/libui.git && cd libui meson setup build ninja -C build # install ui module pecl install ui-beta
݁Ռ ▪ 結果、ビルドできず – 古い文法で書かれてそう? ▪ (最終更新も 7 年前だなぁ・・・) ▪
C に詳しい人ならビルドできるかも? ▪ GitHub の Issue でもみんなビルドできなくて困ってた ISO C99 and later do not support implicit function declarations
·ͱΊ ▪ 素直に NativePHP を使いましょう
͓·͚ ▪ Issue で他のリポジトリがおすすめされてた
DIPQJOTQIQMJCVJ ▪ UI モジュールと同じように libui を使用して動く ▪ Pecl 拡張モジュールではなく FFI
で動く – FFI は PHP で C のコードを動かす仕組み
DIPQJOTQIQMJCVJ require_once __dir__ . "/vendor/toknot/php-libui/src/UI.php"; use UI¥UI; $ui = new
UI('/usr/local/lib/libui.dylib'); $ui->init(); $mainWindow = $ui->newWindow("libui Control Gallery", 640, 480, 1); $ui->controlShow($mainWindow); $ui->main();
͓·͚ͷ·ͱΊ ▪ 「PHP は好きだけど Web は嫌い」みたいなニッチな人にはいいかも ▪ OS デフォルトの UI
を使えるのは利点か ▪ libui のビルドが必要 ▪ 書くコードはわりとつらい – いい感じにラップするフレームワークがあれば良さげ?