There is a difference how svn cat works for deleted files. For deleted file commandline `svn cat -r xxx <full_url>` will give error, but 'svn cat <full_url>@xxx` will cat file from the past.
Unfortunately this method will not cat deleted file.
(PECL svn >= 0.1.0)
svn_cat — Возвращает содержимое файла в репозитории
Возвращает содержимое по URL repos_url
файла
в репозитории по состоянию на ревизию с номером revision_no
(необязательный параметр).
repos_url
Путь URL к элементу в репозитории.
revision_no
Номер ревизии (целое число) соответствующего элемента, по умолчанию - HEAD (последняя ревизия).
Возвращает содержимое элемента в репозитории в случае
успешного завершения или false
в случае возникновения ошибки.
Пример #1 Простой пример использования функции svn_cat()
Этот пример показывает как получить содержимое файла ревизии 28:
<?php
$contents = svn_cat('http://www.example.com/svnroot/calc/gui.c', 28)
?>
Это ЭКСПЕРИМЕНТАЛЬНАЯ функция. Не исключается, что поведение, название и документацию функции изменят без уведомления в следующих версиях PHP. За включение функции в код отвечает программист.
There is a difference how svn cat works for deleted files. For deleted file commandline `svn cat -r xxx <full_url>` will give error, but 'svn cat <full_url>@xxx` will cat file from the past.
Unfortunately this method will not cat deleted file.
Just to add to Adam's comment, when retrieving a file contents I found I got the best results using the same revision in both places every time; ie. as follows:
<?php
svn_cat ($url.'@'.$revision, $revision);
?>
The one appended to the URL is the peg revision, and the one in the second paramer is the operative revision.
This seems to cover all the bases.
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant