TYPO3 CMS  TYPO3_8-7
AbstractExtensionXmlParser.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
21 {
27  protected $authorcompany = null;
28 
34  protected $authoremail = null;
35 
41  protected $authorname = null;
42 
48  protected $category = null;
49 
55  protected $dependencies = null;
56 
62  protected $description = null;
63 
69  protected $extensionDownloadCounter = null;
70 
76  protected $extensionKey = null;
77 
83  protected $lastuploaddate = null;
84 
90  protected $ownerusername = null;
91 
97  protected $reviewstate = null;
98 
104  protected $state = null;
105 
111  protected $t3xfilemd5 = null;
112 
118  protected $title = null;
119 
125  protected $uploadcomment = null;
126 
132  protected $version = null;
133 
139  protected $versionDownloadCounter = null;
140 
153  public function getAll()
154  {
155  $versionProperties = [];
156  $versionProperties['extkey'] = $this->extensionKey;
157  $versionProperties['version'] = $this->version;
158  $versionProperties['alldownloadcounter'] = $this->extensionDownloadCounter;
159  $versionProperties['downloadcounter'] = $this->versionDownloadCounter;
160  $versionProperties['title'] = $this->title;
161  $versionProperties['description'] = $this->description;
162  $versionProperties['state'] = $this->state;
163  $versionProperties['reviewstate'] = $this->reviewstate;
164  $versionProperties['category'] = $this->category;
165  $versionProperties['lastuploaddate'] = $this->lastuploaddate;
166  $versionProperties['uploadcomment'] = $this->uploadcomment;
167  $versionProperties['dependencies'] = $this->dependencies;
168  $versionProperties['authorname'] = $this->authorname;
169  $versionProperties['authoremail'] = $this->authoremail;
170  $versionProperties['authorcompany'] = $this->authorcompany;
171  $versionProperties['ownerusername'] = $this->ownerusername;
172  $versionProperties['t3xfilemd5'] = $this->t3xfilemd5;
173  return $versionProperties;
174  }
175 
183  public function getAlldownloadcounter()
184  {
186  }
187 
195  public function getAuthorcompany()
196  {
197  return $this->authorcompany;
198  }
199 
207  public function getAuthoremail()
208  {
209  return $this->authoremail;
210  }
211 
219  public function getAuthorname()
220  {
221  return $this->authorname;
222  }
223 
231  public function getCategory()
232  {
233  return $this->category;
234  }
235 
243  public function getDependencies()
244  {
245  return $this->dependencies;
246  }
247 
255  public function getDescription()
256  {
257  return $this->description;
258  }
259 
267  public function getDownloadcounter()
268  {
270  }
271 
279  public function getExtkey()
280  {
281  return $this->extensionKey;
282  }
283 
291  public function getLastuploaddate()
292  {
293  return $this->lastuploaddate;
294  }
295 
303  public function getOwnerusername()
304  {
305  return $this->ownerusername;
306  }
307 
315  public function getReviewstate()
316  {
317  return $this->reviewstate;
318  }
319 
327  public function getState()
328  {
329  return $this->state;
330  }
331 
339  public function getT3xfilemd5()
340  {
341  return $this->t3xfilemd5;
342  }
343 
351  public function getTitle()
352  {
353  return $this->title;
354  }
355 
363  public function getUploadcomment()
364  {
365  return $this->uploadcomment;
366  }
367 
375  public function getVersion()
376  {
377  return $this->version;
378  }
379 
386  protected function resetProperties($resetAll = false)
387  {
388  // resetting at least class property "version" is mandatory
389  // as we need to do some magic in regards to
390  // an extension's and version's child node "downloadcounter"
391  $this->version = $this->title = $this->versionDownloadCounter = $this->description = $this->state = $this->reviewstate = $this->category = $this->lastuploaddate = $this->uploadcomment = $this->dependencies = $this->authorname = $this->authoremail = $this->authorcompany = $this->ownerusername = $this->t3xfilemd5 = null;
392  if ($resetAll) {
393  $this->extensionKey = $this->extensionDownloadCounter = null;
394  }
395  }
396 
403  protected function convertDependencies($dependencies)
404  {
405  $newDependencies = [];
406  $dependenciesArray = unserialize($dependencies, ['allowed_classes' => false]);
407  if (is_array($dependenciesArray)) {
408  foreach ($dependenciesArray as $version) {
409  if (!empty($version['kind']) && !empty($version['extensionKey'])) {
410  $newDependencies[$version['kind']][$version['extensionKey']] = $version['versionRange'];
411  }
412  }
413  }
414  return serialize($newDependencies);
415  }
416 }