4 require_once
'Services/Administration/interfaces/interface.ilVersionControlInformation.php';
33 return (
bool) preg_match(
'/^\d+(:\d+)*[MSP]*$/', $revision);
41 return file_exists(self::SVN_GET_17_FILE) && is_file(self::SVN_GET_17_FILE) && is_readable(self::SVN_GET_17_FILE);
49 return file_exists(self::SVN_LT_17_FILE) && is_file(self::SVN_LT_17_FILE) && is_readable(self::SVN_LT_17_FILE);
59 $lng = $DIC->language();
61 if (null !== self::$revision_information) {
62 return self::$revision_information;
67 if (self::isProbablySubversion17()) {
68 if (extension_loaded(
'PDO') && extension_loaded(
'pdo_sqlite')) {
70 $wcdb =
new PDO(
'sqlite:' . self::SVN_GET_17_FILE);
72 $result = $wcdb->query(
'SELECT MAX("revision") current_rev FROM "NODES"');
75 $revision = $row[
'current_rev'];
76 if (self::isSvnRevision($revision)) {
77 $info[] = sprintf(
$lng->txt(
'svn_revision_current'), $revision);
83 $result = $wcdb->query(
'SELECT "changed_revision" last_changed_revision FROM "NODES" ORDER BY changed_revision DESC LIMIT 1');
86 $revision = $row[
'last_changed_revision'];
87 if (self::isSvnRevision($revision)) {
88 $info[] = sprintf(
$lng->txt(
'svn_revision_last_change'), $revision);
94 $result = $wcdb->query(
'SELECT * FROM REPOSITORY ');
97 $info[] = sprintf(
$lng->txt(
'svn_root'), $row[
'root']);
101 $result = $wcdb->query(
'SELECT * FROM "NODES" WHERE local_relpath LIKE "%inc.ilias_version.php"');
103 foreach ($result as
$row) {
104 $path = dirname(dirname($row[
'repos_path']));
114 if (function_exists(
'shell_exec') && is_callable(
'shell_exec')) {
115 $revision = trim(shell_exec(
'svnversion ' . realpath(getcwd())));
116 if (self::isSvnRevision($revision)) {
117 $info[] = sprintf(
$lng->txt(
'svn_revision_current'), $revision);
120 if (self::isProbablySubversionLower17()) {
121 $svnfile = file(self::SVN_LT_17_FILE);
122 $revision = $svnfile[3];
123 if (self::isSvnRevision($revision)) {
124 $info[] = sprintf(
$lng->txt(
'svn_revision_last_change'), $revision);
129 self::$revision_information =
$info;
139 return implode(
"<br />", self::$revision_information);