Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
PeachPieを使ってPHPを.NETで動かしてみた
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
くろきり
March 25, 2023
430
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PeachPieを使ってPHPを.NETで動かしてみた
PHPerKaigi2023の登壇資料です
くろきり
March 25, 2023
More Decks by くろきり
See All by くろきり
リアルISUCONの戦い方
kurokiri
0
380
なぜPHPStanやPHP CodeSnifferを導入するのか 〜受託開発編〜
kurokiri
0
360
少人数チーム開発でのレガシープロダクトとの向き合い方
kurokiri
0
1.4k
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
710
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
エンジニアに許された特別な時間の終わり
watany
109
250k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
How to build a perfect <img>
jonoalderson
1
6k
Speed Design
sergeychernyshev
33
2.1k
Designing for humans not robots
tammielis
254
26k
Darren the Foodie - Storyboard
khoart
PRO
4
3.9k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Transcript
PeachPieを使ってPHPを .NETで動かしてみた PHPerKaigi 2023 @9rokirishima
自己紹介 • 緒方 大佑(おがた だいすけ) • Twitter:くろきり(@9rokirishima) • 所属 ◦
Growfit株式会社 ◦ Webエンジニア(PHPer) • この後仕事の本番作業もあるので色んな意味で緊張しています。
公式サイト:https://www.peachpie.io/ GitHub:https://github.com/peachpiecompiler/peachpie • .NETランタイム上でPHPを実行するためのオープンソースツール ◦ PHPをILコード(.NETの中間言語)へコンパイル • PHPを.NETで動かすだけでなくC#とPHPの相互運用が可能
.NETとは • マイクロソフトが開発したマルチプラットフォーム向けの開発者フ レームワーク • 主にC#とセットで使われている • .Net Frameworkや.Net Coreなど用途に応じて使い分けられてい
たが現在は.NETに統合
相互運用って?
C#からPHPを呼ぶ
PHPからC#を呼ぶ
PHPからC#を呼ぶ PHPスクリプトの状態では参照が効かない ※実行する時はコンパイルするのでこの状態で エラーが出ていてもちゃんと動く
使えるプロジェクトテンプレート
例えば webのプロジェクトを作成してphpinfoを表示する
例えば 構成 C#はWebサーバーの立ち上げを行う PHPは実際のコンテンツ
例えば ・Website.msbuildproj クラスライブラリとして出力される
コンソールアプリ以外はPHPで作られたコードは ライブラリとして出力され、それをC#側で実行する仕組み
クラスライブラリ化することで 様々な.Netプロジェクトに組み込める!
つまづいた所
※今回の開発端末はMacです
• VisualStudio for MacはMarketPlaceが使えないため、PeachPie のプラグインがインストールできない ◦ PeachPieが提供する機能を使う場合は結構辛い • 開発中PHPからC#呼ぶ時参照できない 辛い点
• .NETのクラスライブラリとして実装することで様々なプロジェクトで PHPのコードを動かすことができる • 違う環境でPHPを動かすのは面白い! まとめ
ご清聴ありがとうございました!