1
|
|
|
<?php |
2
|
|
|
$ARCurrent->nolangcheck=true; |
3
|
|
|
if ($this->CheckLogin("layout") && $this->CheckConfig()) { |
4
|
|
|
$this->resetloopcheck(); |
5
|
|
|
if ($dirlist) { |
6
|
|
|
foreach ($dirlist as $item) { |
7
|
|
|
if ($item['kind'] == "dir") { |
8
|
|
|
//echo "found dir: " . $item['name'] . "<br>"; |
9
|
|
|
|
10
|
|
|
$dirinfo = array(); |
11
|
|
|
$dirinfo['ar:path'] = basename($item['name']); |
12
|
|
|
// Check if the dir exists - if not, create the object in Ariadne. |
13
|
|
|
$dirpath = $this->path . $dirinfo['ar:path'] . "/"; |
14
|
|
|
|
15
|
|
|
if (!$this->exists($dirpath)) { |
16
|
|
|
|
17
|
|
|
// Fetch type and name information from SVN. |
18
|
|
|
// If not found in SVN: |
19
|
|
|
// type defaults to psection |
20
|
|
|
// name defaults to pathname |
21
|
|
|
$svn_type = $fstore->svn_rpropget($svn, $repository, "ar:type", $dirinfo['ar:path'], $revision); |
22
|
|
View Code Duplication |
if ($svn_type && !ar_error::isError($svn_type) && $svn_type['property']['text'] != "") { |
23
|
|
|
$svn_type = $svn_type['property']['text']; |
24
|
|
|
//echo "SVN type: [$svn_type]<br>"; |
25
|
|
|
$dirinfo['ar:type'] = $svn_type; |
26
|
|
|
} else { |
27
|
|
|
//echo "SVN type not found, default to psection<br>"; |
28
|
|
|
$dirinfo['ar:type'] = "psection"; |
29
|
|
|
} |
30
|
|
|
$svn_name = $fstore->svn_rpropget($svn, $repository, "ar:name", $dirinfo['ar:path'], $revision); |
31
|
|
|
|
32
|
|
View Code Duplication |
if ($svn_name && !ar_error::isError($svn_name) && $svn_name['property']['text'] != "") { |
33
|
|
|
$dirinfo['ar:name'] = $svn_name['property']['text']; |
34
|
|
|
} else { |
35
|
|
|
$dirinfo['ar:name'] = $dirinfo['ar:path']; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
echo "<span class='svn_adddirline'>Adding ".$this->path.$dirinfo['ar:path']." (".$dirinfo['ar:type'].")</span>\n"; |
39
|
|
|
|
40
|
|
|
// Create the new object in Ariadne. |
41
|
|
|
$newData = array(); |
42
|
|
|
$newData['arNewFilename'] = $dirinfo['ar:path']; |
43
|
|
|
$newData['arNewType'] = $dirinfo['ar:type']; |
44
|
|
|
$newData[$ARConfig->nls->default]['name'] = $dirinfo['ar:name']; |
45
|
|
|
$this->call("system.new.phtml", $newData); |
46
|
|
|
|
47
|
|
|
if ($this->error) { |
48
|
|
|
echo "Error: " . $this->error . "\n"; |
49
|
|
|
} else { |
50
|
|
|
$arCallArgs['repository'] = $repository; |
51
|
|
|
$arCallARgs['revision'] = $revision; |
52
|
|
|
$this->get($dirpath, "system.svn.checkout.recursive.php", $arCallArgs); |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
} |
56
|
|
|
} |
57
|
|
|
} |
58
|
|
|
} |
59
|
|
|
?> |
|
|
|
|
60
|
|
|
|
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.