我正在编写类似在线 PHP 编辑器的代码。因此,现在我可以选择将使用编辑器创建的 Web 应用程序移植为 Chrome 扩展(弹出窗口)。它工作正常,但创建的文件需要下载、打包(使用 Chrome 或 cmd)并重新上传。我确实有这个规定,但我发现每次我需要更新我的应用程序时都要经历这个例程,这让我很烦恼。
所以,我只是想知道是否有某种方法可以从网络本身打包 Chrome 扩展?
编辑:我知道这可以使用 Ruby 甚至 Python。想知道 PHP 是否可以实现同样的功能。我尝试过,但没有成功。
I am coding something like an online PHP editor. So, now I have this option to port the web applications created using the editor as Chrome extensions (popup). It works okay save the fact that the files created need to be downloaded, packaged (using Chrome or cmd) and re-uploaded. I do have this provision but I find it annoying myself to go through this routine everytime I need to make an update to my application.
So, I just want to know if there is some way we can package Chrome extensions from the web itself?
Edit: I know this can be done using Ruby or even Python. Want to know if the same can be done in PHP. I tried in vain.
发布评论
评论(1)
如果您有命令行打包程序,您也许能够创建一个帮助程序服务,该服务可以将扩展名发布到它,通过
exec()
或类似的方式在您的 Web 服务器上运行打包程序PHP,然后将结果文件返回给客户端(或者保存在服务器上)。根据您的需要,可以通过 AJAX 请求或直接表单提交来调用此帮助程序。If you have a command-line packagers, you might be able to create a helper service that can have the extension POST'd to it, run the packager on your web server via
exec()
or similar in PHP, and then return the resulting file to the client (or save it on the server). This helper could be called via an AJAX request or direct form submission depending on your needs.