8653a6f91ef215c3ff8f48bcdc3b6dee3825c55f
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Utility / Parser / AbstractMirrorXmlParser.php
1 <?php
2 namespace TYPO3\CMS\Extensionmanager\Utility\Parser;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2010-2013 Marcus Krause <marcus#exp2010@t3sec.info>
8 * Steffen Kamper <info@sk-typo3.de>
9 * All rights reserved
10 *
11 * This script is part of the TYPO3 project. The TYPO3 project is
12 * free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * The GNU General Public License can be found at
18 * http://www.gnu.org/copyleft/gpl.html.
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Abstract parser for TYPO3's mirror.xml file.
29 *
30 * @author Marcus Krause <marcus#exp2010@t3sec.info>
31 * @author Steffen Kamper <info@sk-typo3.de>
32 * @since 2010-02-09
33 */
34 abstract class AbstractMirrorXmlParser extends AbstractXmlParser {
35
36 /**
37 * Keeps country of currently processed mirror.
38 *
39 * @var string
40 */
41 protected $country = NULL;
42
43 /**
44 * Keeps hostname of currently processed mirror.
45 *
46 * @var string
47 */
48 protected $host = NULL;
49
50 /**
51 * Keeps path to mirrored TER of currently processed mirror.
52 *
53 * @var string
54 */
55 protected $path = NULL;
56
57 /**
58 * Keeps sponsor link of currently processed mirror.
59 *
60 * @var string
61 */
62 protected $sponsorlink = NULL;
63
64 /**
65 * Keeps sponsor logo location of currently processed mirror.
66 *
67 * @var string
68 */
69 protected $sponsorlogo = NULL;
70
71 /**
72 * Keeps sponsor name of currently processed mirror.
73 *
74 * @var string
75 */
76 protected $sponsorname = NULL;
77
78 /**
79 * Keeps title of currently processed mirror.
80 *
81 * @var string
82 */
83 protected $title = NULL;
84
85 /**
86 * Returns an associative array of all mirror properties.
87 *
88 * Valid array keys of returned array are:
89 * country, host, path, sponsorlink, sponsorlogo, sponsorname, title
90 *
91 * @access public
92 * @return array assoziative array of a mirror's properties
93 * @see $country, $host, $path, $sponsorlink, $sponsorlogo, $sponsorname, $title
94 */
95 public function getAll() {
96 $mirrorProperties = array();
97 $mirrorProperties['title'] = $this->title;
98 $mirrorProperties['host'] = $this->host;
99 $mirrorProperties['path'] = $this->path;
100 $mirrorProperties['country'] = $this->country;
101 $mirrorProperties['sponsorname'] = $this->sponsorname;
102 $mirrorProperties['sponsorlink'] = $this->sponsorlink;
103 $mirrorProperties['sponsorlogo'] = $this->sponsorlogo;
104 return $mirrorProperties;
105 }
106
107 /**
108 * Returns country of currently processed mirror.
109 *
110 * @access public
111 * @return string name of country a mirror is located in
112 * @see $country, getAll()
113 */
114 public function getCountry() {
115 return $this->country;
116 }
117
118 /**
119 * Returns host of currently processed mirror.
120 *
121 * @access public
122 * @return string host name
123 * @see $host, getAll()
124 */
125 public function getHost() {
126 return $this->host;
127 }
128
129 /**
130 * Returns path to mirrored TER of currently processed mirror.
131 *
132 * @access public
133 * @return string path name
134 * @see $path, getAll()
135 */
136 public function getPath() {
137 return $this->path;
138 }
139
140 /**
141 * Returns sponsor link of currently processed mirror.
142 *
143 * @access public
144 * @return string URL of a sponsor's website
145 * @see $sponsorlink, getAll()
146 */
147 public function getSponsorlink() {
148 return $this->sponsorlink;
149 }
150
151 /**
152 * Returns sponsor logo location of currently processed mirror.
153 *
154 * @access public
155 * @return string a sponsor's logo location
156 * @see $sponsorlogo, getAll()
157 */
158 public function getSponsorlogo() {
159 return $this->sponsorlogo;
160 }
161
162 /**
163 * Returns sponsor name of currently processed mirror.
164 *
165 * @access public
166 * @return string name of sponsor
167 * @see $sponsorname, getAll()
168 */
169 public function getSponsorname() {
170 return $this->sponsorname;
171 }
172
173 /**
174 * Returns title of currently processed mirror.
175 *
176 * @access public
177 * @return string title of mirror
178 * @see $title, get All()
179 */
180 public function getTitle() {
181 return $this->title;
182 }
183
184 /**
185 * Method resets version class properties.
186 *
187 * @access protected
188 * @return void
189 * @see $country, $host, $path, $sponsorlink, $sponsorlogo, $sponsorname, $title
190 */
191 protected function resetProperties() {
192 $this->title = $this->host = $this->path = $this->country
193 = $this->sponsorname = $this->sponsorlink = $this->sponsorlogo = NULL;
194 }
195
196 }