Ste*_*rig 15
要指定第二个(更简单)解决方案phjr:
version.txt
在您自己的公共服务器上有一个文件,并在您部署的项目/脚本中包含以下函数:
define('REMOTE_VERSION', 'http://your.public.server/version.txt');
// this is the version of the deployed script
define('VERSION', '1.0.1');
function isUpToDate()
{
$remoteVersion=trim(file_get_contents(REMOTE_VERSION));
return version_compare(VERSION, $remoteVersion, 'ge');
}
Run Code Online (Sandbox Code Playgroud)
version.txt
应该只包含最新的版本号,例如:
1.0.2
Run Code Online (Sandbox Code Playgroud)