How To Get Subversion Revision ID From PHP Subversionのリビジョン番号を取得する方法PHPから
First of all identify the file(s) for which you want to know the revision number from PHP.まず第一に識別するためのファイル(秒)を取得したいのリビジョン番号を知ってからPHPのです。 Then add a property to the file as follows:ファイルを追加するプロパティを入力し、以下のとおり:
svn propset svn:keywords Revision file_name.php svn propsetにsvn : keywordsリビジョンfile_name.php
Now add the following function within php blocks:今すぐに次の関数を追加してPHPのブロック:
/** Returns revision number */ function getSCID() { $svnid = '$Rev: 43 $'; $scid = substr($svnid, 6); return intval(substr($scid, 0, strlen($scid) - 2)); } / **戻り値のリビジョン番号* /機能getscid ( ) ( $ svnid = ' $改訂: 43 $ ' ; $を除けば、 Scid = substr ( $ svnid 、 6 ) ;復帰するintval ( substr ( $を除けば、 Scid 、 0 、 strlen ( $を除けば、 Scid ) -2 ) ) ; ) You can now access the revision number of this file from PHP by calling getSCID().今すぐにアクセスすることができますリビジョン番号を呼び出すことによって、このファイルからPHPのgetscid ( ) 。 It returns an integer.それが整数値を返す。
Note: Revision numbers are essential in writing upgrade scripts注:リビジョン番号が欠かせない書面でのアップグレードスクリプト
Filed under提出されて Headline Newsニュースの見出し , 、 Open Source Softwareオープンソースのソフトウェア , 、 PHP PHPの , 、 Technology技術 | |
| |
RSS 2.0 RSS 2.0を | |
Trackbackトラックバック this Article |この記事|
Email this Article電子メールこの記事
You may also like to readを読むようにすることも可能 |




































July 8th, 2008 at 12:24 am 2008年7月8日12:24 AMに
Does this only work when you have actual access to the SVN or could you use this to check the revision number when you have anonymous access?が、この場合にのみ動作します。 svnのアクセスを実際に使ったり、これを使用するときにリビジョン番号を確認するには、匿名アクセスですか?