1
|
|
|
<?php |
2
|
|
|
$ARCurrent->nolangcheck = true; |
3
|
|
|
|
4
|
|
|
if ($this->CheckLogin("layout") && $this->CheckConfig()) { |
5
|
|
|
set_time_limit(0); |
6
|
|
|
$this->resetloopcheck(); |
7
|
|
|
|
8
|
|
|
$fstore = $this->store->get_filestore_svn("templates"); |
9
|
|
|
$svn = $fstore->connect($this->id, $this->getdata("username"), $this->getdata("password")); |
10
|
|
|
|
11
|
|
|
$svn_info = $fstore->svn_info($svn); |
12
|
|
|
$stored_repository = rtrim($svn_info['url'], "/") . "/"; |
13
|
|
|
$revision = $this->getdata('revision'); |
14
|
|
|
$repository = $this->getdata('repository'); |
15
|
|
|
|
16
|
|
|
$repoPath = $this->getdata("repoPath"); |
17
|
|
|
|
18
|
|
|
if ($repoPath) { |
19
|
|
|
$repo_subpath = substr($this->path, strlen($repoPath)); |
20
|
|
|
$repository = rtrim($repository, "/") . "/" . $repo_subpath; |
21
|
|
|
} else { |
22
|
|
|
$repository = $stored_repository; |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
if (!$svn_info) { |
26
|
|
|
echo "\n<span class='svn_error'>" . $this->path . ": is not in SVN.</span>\n"; |
27
|
|
|
flush(); |
28
|
|
|
} else if (($repository != $stored_repository) && $revision) { |
29
|
|
|
echo "Checked repo: [$repository] [$stored_repository] rev $revision"; |
30
|
|
|
echo "\n<span class='svn_error'>" . $this->path . ": " . $ARnls['err:svn:leaving_recurse_tree'] . "</span>\n"; |
31
|
|
|
flush(); |
32
|
|
|
} else { |
33
|
|
|
// we really need to update this, call the update template |
34
|
|
|
$result = $this->call('system.svn.update.php', $arCallArgs); |
35
|
|
|
|
36
|
|
|
// Run update on the existing subdirs. |
37
|
|
|
$arCallArgs['repoPath'] = $this->path; |
38
|
|
|
$arCallArgs['repository'] = $repository; |
39
|
|
|
$arCallArgs['revision'] = $revision; |
40
|
|
|
|
41
|
|
|
$this->ls($this->path, "system.svn.update.recursive.php", $arCallArgs); |
42
|
|
|
|
43
|
|
|
// Create the dirs, restore them if needed. |
44
|
|
|
$dirlist = $fstore->svn_list($svn, $revision); |
45
|
|
View Code Duplication |
if ($dirlist) { |
46
|
|
|
$arCallArgs['dirlist'] = $dirlist; |
47
|
|
|
$arCallArgs['svn'] = $svn; |
48
|
|
|
$arCallArgs['fstore'] = $fstore; |
49
|
|
|
$arCallArgs['repository'] = $repository; |
50
|
|
|
$this->call("system.svn.checkout.dirs.php", $arCallArgs); |
51
|
|
|
} |
52
|
|
|
flush(); |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
?> |
|
|
|
|
56
|
|
|
|
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.