更新 PHP 框架
有谁知道有一个框架(用 PHP 编写)来更新基于 PHP 的软件吗?
我正在考虑一个库,它可以帮助在线检查更新,并提供生成、下载、验证和安装更新包的方法,甚至可以使用加密和公钥签名。
最好使用非 Copyleft 开源许可证(例如 BSD 或 MIT 许可证,无 GPL)。
虽然源代码控制工具在理论上很好,但它们可能会使 PHP 应用程序的(初始)部署复杂化,因为它们不是基于 PHP 的(限制可移植性)并且通常非常大。
Does anyone know of a framework (written in PHP) to update PHP-based software ?
I'm thinking of a library that assists in checking for updates online and that provides methods for generating, downloading, verifying and installing update packages, maybe even with encryption and public-key signatures.
Ideally with a non-copyleft open source license (e.g. BSD or MIT License, no GPL).
While source control tools are nice in theory, they can complicate (initial) deployment of PHP applications as they are not PHP-based (limits portability) and are often quite large.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我现在已经开发了自己的解决方案,它提供了生成、验证和安装更新包的功能。
基本上,它使用 PHP 的 OpenSSL 函数进行对称加密密钥的公钥加密 (RSA)、用于对称加密 (AES) 的 mcrypt 和 ZIP 作为容器格式。这些构建块用于创建紧凑的更新包并确保数据完整性和真实性。
还可以使用
openssl_pkcs7_sign()
和openssl_pkcs7_encrypt()
和它们的对应项用于符合 MIME 的加密,但是这些函数似乎使用 7 位编码,因此使档案相当大。Web 应用程序必须将其所有文件和独立于系统的数据放在一个应用程序目录中,可以替换该目录来升级应用程序。
更新的执行方式如下:
将 ZIP 存档内容提取到临时位置
当您控制所有目标系统时,版本/源代码控制系统(例如 git)很好,但否则我认为您不应该要求客户安装和操作第三方软件,您也必须为其提供支持,而是提供与您的软件的其余部分良好集成的软件更新用户界面。
I've developed my own solution now which provides functions for generating, verifying and installing update packages.
Basically, it uses PHP's OpenSSL functions for public-key encryption (RSA) of the key for symmetric encryption, mcrypt for symmetric encryption (AES) and ZIP as the container format. These building blocks are used to create compact update packages and ensure data integrity and authenticity.
One could also use
openssl_pkcs7_sign()
andopenssl_pkcs7_encrypt()
and their counterparts for MIME-compliant encryption, however these functions seem to use 7-bit encoding and therefore make archives rather large.The web application must have all its files and system-independent data in a single application directory that can be replaced to upgrade the application.
Updating is performed as follows:
Extracting the ZIP archive contents to a temporary location
Version / source control systems such as git are nice when you are the one in control of all target systems but otherwise I think you should not require the customer to install and operate third-party software for which you would have to provide support as well but rather provide a user interface for software updates that integrates well with the rest of your software.
一个使用源代码控制工具(如 git)来检查新更新并加载最新提交的软件怎么样?
What about a software that uses the source control tool, like git to check for new updates and loads the newest commit?