Class ilSubversionInformation.
More...
◆ detect()
static ilSubversionInformation::detect |
( |
| ) |
|
|
staticprivate |
Definition at line 55 of file class.ilSubversionInformation.php.
References $DIC, $info, $lng, $path, $result, $row, array, and 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;
Reload workbook from saved file
Create styles array
The data for the language used.
◆ getInformationAsHtml()
ilSubversionInformation::getInformationAsHtml |
( |
| ) |
|
◆ isProbablySubversion17()
static ilSubversionInformation::isProbablySubversion17 |
( |
| ) |
|
|
staticprivate |
- Returns
- bool
Definition at line 39 of file class.ilSubversionInformation.php.
41 return file_exists(self::SVN_GET_17_FILE) && is_file(self::SVN_GET_17_FILE) && is_readable(self::SVN_GET_17_FILE);
◆ isProbablySubversionLower17()
static ilSubversionInformation::isProbablySubversionLower17 |
( |
| ) |
|
|
staticprivate |
- Returns
- bool
Definition at line 47 of file class.ilSubversionInformation.php.
49 return file_exists(self::SVN_LT_17_FILE) && is_file(self::SVN_LT_17_FILE) && is_readable(self::SVN_LT_17_FILE);
◆ isSvnRevision()
static ilSubversionInformation::isSvnRevision |
( |
|
$revision | ) |
|
|
staticprivate |
◆ $revision_information
ilSubversionInformation::$revision_information = null |
|
staticprivate |
◆ SVN_GET_17_FILE
const ilSubversionInformation::SVN_GET_17_FILE = '.svn/wc.db' |
◆ SVN_LT_17_FILE
const ilSubversionInformation::SVN_LT_17_FILE = '.svn/entries' |
The documentation for this class was generated from the following file: