TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

NativePHP: A framework for building desktop apps using PHP

179 点作者 brysonreece将近 2 年前

26 条评论

LinguaBrowse将近 2 年前
The documentation says it builds “truly native” apps, so I was expecting direct PHP bindings to native APIs and for the UI to be fully native (AppKit, GTK, etc.). On closer inspection, though, it’s just a PHP framework on top of Electron? A bit disingenuous.
评论 #36821797 未加载
评论 #36870137 未加载
评论 #36822679 未加载
评论 #36979545 未加载
smashed将近 2 年前
What exactly is &quot;native&quot; about this?<p>I remember there was PHP bindings for GTK [0], which at least looked sort of native on Linux.<p>This could be cool if you can ship a large PHP backend codebase, allowing a web app to become an offline desktop app. You&#x27;d probably have to bundle a MySQL instance many cases though :)<p>0: <a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;PHP-GTK" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;PHP-GTK</a>
评论 #36824289 未加载
评论 #36822320 未加载
评论 #36822024 未加载
AndroTux将近 2 年前
I’m a huge PHP fan. But hell, no.<p>Why don’t we use tools for the things they are good at? PHP as a backend server language is great, because it was built for it. Just like JavaScript is intended for web frontend applications. In my opinion, nodeJS was a mistake. It’s built upon layers of workarounds, and NativePHP looks exactly the same, just the other way around.<p>It’s not that hard to learn another programming language once you’ve learned one, so why not learn to code in a language that’s designed for your task, instead of trying to frankenstein some monster just so you don’t have to learn a new language?
评论 #36824341 未加载
评论 #36825729 未加载
评论 #36826411 未加载
dceddia将近 2 年前
I haven’t seen anyone talking about how this supports Tauri yet, so I’ll start: that’s pretty great!<p>For anyone who hasn’t heard of it yet, Tauri is a really nice Electron-like alternative that uses the system webview instead of shipping an entire copy of Chromium, and it’s written in Rust, so I’d presume there’ll be some way to call out to Rust from PHP.<p>I’m excited to see Tauri get more adoption. I’ve been building&#x2F;selling a video editor with it for the past couple years and while it’s not always perfect, it suits my needs and I like that native performance is always an option when I need it. I’ve yet to run into a performance problem that is completely out of my control. Not to say my app is perfect, just that where it’s slow, it’s not JavaScript’s fault.
评论 #36823196 未加载
评论 #36822446 未加载
评论 #36823064 未加载
splatzone将近 2 年前
Nice! I remember using a tool called Appcelerator Titanium about 15 years ago. It was like a precursor to Electron, and you could use various languages to build desktop and mobile apps - including PHP. It blew my mind at the time that this was possible.<p><a href="https:&#x2F;&#x2F;benramsey.com&#x2F;blog&#x2F;2009&#x2F;10&#x2F;building-titanium-with-php&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;benramsey.com&#x2F;blog&#x2F;2009&#x2F;10&#x2F;building-titanium-with-ph...</a><p>Glad to see the PHP desktop app dream has been kept alive :)
评论 #36836278 未加载
freedomben将近 2 年前
<i>Your Scientists Were So Preoccupied With Whether Or Not They Could, They Didn’t Stop To Think If They Should.</i><p>On a serious note, this is absolutely badass. In the spirit of hacking, kudos!<p>The ideal market for this seems to be people with only PHP web app experience that need or want to build a &quot;native&quot; app, that otherwise wouldn&#x27;t be able to do so with existing tools.
评论 #36821071 未加载
评论 #36826421 未加载
lawgimenez将近 2 年前
Native is such an overused word. Lately I have to argue with clients what’s really native or not.
评论 #36823194 未加载
评论 #36822296 未加载
karencarits将近 2 年前
I am a bit surprised by the critical tone in the comments here. Phpdesktop [1] is, for example, a very nice application, and the ability of php to just make some simple scripts on the go and have something that works, is wonderful (compared to js where you often have to build etc, the threshold of getting started on a new computer is high). I have several times needed to make simple applications with a database, and php is perfect for that usecase. Making it simpler to share these applications to non-technical users for offline use is nice<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;cztomczak&#x2F;phpdesktop">https:&#x2F;&#x2F;github.com&#x2F;cztomczak&#x2F;phpdesktop</a>
评论 #36825704 未加载
omgmajk将近 2 年前
Honestly excited about this, I am one of those people that really love PHP from the old days and I still use it from time to time to build small web apps and api&#x27;s. I don&#x27;t get the hate that PHP usually gets, I&#x27;ve always kinda liked it.<p>These days I mostly program in C, CAPL and Python but I would love to build apps in PHP.
评论 #36821538 未加载
评论 #36821274 未加载
评论 #36824116 未加载
iambateman将近 2 年前
So, I’m incredibly enthusiastic about this.<p>It’s ok if you aren’t, but I am.<p>Development is easier when we keep more things the same. It saves energy for a Laravel developer to deploy to Mac using the same code, tools, and architectures as their web app. This won’t be true for all mac apps, but certainly will be for some.<p>Maybe NativePHP turns into a big deal and helps a lot of people deliver great experiences or maybe it doesn’t…but I’m grateful to the team for their effort pushing the boundaries.
评论 #36822081 未加载
JodieBenitez将近 2 年前
Somehow related, I&#x27;ve been using pywebview for some internal tools: <a href="https:&#x2F;&#x2F;github.com&#x2F;r0x0r&#x2F;pywebview">https:&#x2F;&#x2F;github.com&#x2F;r0x0r&#x2F;pywebview</a><p>Probably not as full-featured as Electronjs, but since we have a bunch of python scripts to convert to desktop apps, it&#x27;s very useful.
tjpnz将近 2 年前
dang can you update the title to reflect that this is a framework for building Electron apps in PHP? The name they&#x27;ve chosen is unfortunate and some are feeling misled.
dashesyan将近 2 年前
Should be called ElectronPHP
评论 #36821234 未加载
评论 #36821487 未加载
评论 #36822341 未加载
tambourine_man将近 2 年前
&gt; NativePHP is taking the world by storm…<p>I like PHP, but this made me chuckle.
ulrischa将近 2 年前
Great. PHP became a very good programming language. Sadly it has to fight with a bad reputation from its past.
p4bl0将近 2 年前
In the same kind of spirit but for Python I recently discovered pywebview. It really is amazing how simple and fast these tools make developing little apps that can be run locally, without your users needing to manually launch a server or you worrying about the browser.
aetherspawn将近 2 年前
Are there any screenshots anywhere to understand what kind of app this is for?
评论 #36822010 未加载
hahamaster将近 2 年前
$NativePHP: A $framework for $building $desktop $apps $using PHP
评论 #36832461 未加载
joeldo将近 2 年前
So it ships Electron and a PHP runtime - What else can we include?
评论 #36820959 未加载
评论 #36822356 未加载
评论 #36821905 未加载
penlightment将近 2 年前
Everyone is focusing on the fact that `native` is not applicable to the current implementation. I think if done right, It can come quite handy
paulvandermeijs将近 2 年前
I&#x27;m a bit confused by the fact that all code samples in the docs are missing PHP tags.<p>I assume they&#x27;re still required since leaving them out would probably mess up all editor and tooling support.<p>Despite the great improvements PHP has seen lately it will always be a template language for me as long as you have to write your code between those tags.
rvz将近 2 年前
There is nothing &#x27;native&#x27; about this at all. Just a PHP library on top of Electron against the claim of &quot;truly native&quot; apps.
meatjuice将近 2 年前
why php though?
评论 #36822162 未加载
efitz将近 2 年前
Speaking as a security professional, for the love of God, why?
评论 #36823644 未加载
quasarj将近 2 年前
Why do people keep trying to resurrect PHP?
评论 #36822762 未加载
评论 #36822780 未加载
dolni将近 2 年前
Does anybody think that something like this is useful except as an academic exercise? I can&#x27;t get there.<p>There are many languages better suited to delivering native apps. The pitfalls of electron are already well understood. If you need electron ANYWAY, then you might as well just use electron.