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);
55 private static function detect()
62 if(null !== self::$revision_information)
64 return self::$revision_information;
69 if(self::isProbablySubversion17())
71 if(extension_loaded(
'PDO') && extension_loaded(
'pdo_sqlite'))
75 $wcdb =
new PDO(
'sqlite:' . self::SVN_GET_17_FILE);
77 $result = $wcdb->query(
'SELECT MAX("revision") current_rev FROM "NODES"');
82 $revision = $row[
'current_rev'];
83 if(self::isSvnRevision($revision))
85 $info[] = sprintf($lng->txt(
'svn_revision_current'), $revision);
91 $result = $wcdb->query(
'SELECT "changed_revision" last_changed_revision FROM "NODES" ORDER BY changed_revision DESC LIMIT 1');
96 $revision = $row[
'last_changed_revision'];
97 if(self::isSvnRevision($revision))
99 $info[] = sprintf($lng->txt(
'svn_revision_last_change'), $revision);
105 $result = $wcdb->query(
'SELECT * FROM REPOSITORY ');
110 $info[] = sprintf($lng->txt(
'svn_root'), $row[
'root']);
114 $result = $wcdb->query(
'SELECT * FROM "NODES" WHERE local_relpath LIKE "%inc.ilias_version.php"');
117 foreach($result as
$row)
119 $path = dirname(dirname($row[
'repos_path']));
122 $info[] = sprintf($lng->txt(
'svn_path'),
$path);
132 if(function_exists(
'shell_exec') && is_callable(
'shell_exec'))
134 $revision = trim(shell_exec(
'svnversion ' . realpath(getcwd())));
135 if(self::isSvnRevision($revision))
137 $info[] = sprintf($lng->txt(
'svn_revision_current'), $revision);
140 if(self::isProbablySubversionLower17())
142 $svnfile =
file(self::SVN_LT_17_FILE);
143 $revision = $svnfile[3];
144 if(self::isSvnRevision($revision))
146 $info[] = sprintf($lng->txt(
'svn_revision_last_change'), $revision);
151 self::$revision_information =
$info;
161 return implode(
"<br />", self::$revision_information);
Reload workbook from saved file
Create styles array
The data for the language used.