在 PHP 页面中嵌入 svn 修订号的简单方法? [英] Easy way to embed svn revision number in page in PHP?

查看:27
本文介绍了在 PHP 页面中嵌入 svn 修订号的简单方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

注意到在这个页面的右下角它有 SVN 版本号吗?我假设这是动态的.

Notice in the bottom right hand corner of this page it has the SVN revision id? I'm assuming that's dynamic.

我很想将它添加到我的一些网站中,就像在源代码中添加注释一样,以确保代码推送能够通过.

I'd love to add that to some of my sites, just as a comment in the source to make sure code pushes are going through.

注意:您还可以假设相关站点的工作目录是相关存储库的 svn checkout.

NOTE: You can also assume that the working directory of the site in question is an svn checkout of the repo in question.

我正在寻找全局修订号,而不是我正在查看的文件的修订号.

I'm looking for the global revision number, not the revision number of the file I'm looking at.

推荐答案

您可以使用 svnversion CLI 实用程序,用于更具体地查看修订版本,包括最高编号.然后您可以使用正则表达式来解析它.

You can use the svnversion CLI utility to get a more specific look at the revision, including the highest number. You could then use regular expressions to parse this.

Subversion 没有全局修订的概念;相反,您必须递归地查看工作副本以找到最高的修订号.svnversion 为您做到这一点.

Subversion has no concept of a global revision; rather, you'd have to recursively look through the working copy to find the highest revision number. svnversion does that for you.

这篇关于在 PHP 页面中嵌入 svn 修订号的简单方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆