TYPO3 CMS  TYPO3_7-6
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 
25 {
31  protected $authorcompany = null;
32 
38  protected $authoremail = null;
39 
45  protected $authorname = null;
46 
52  protected $category = null;
53 
59  protected $dependencies = null;
60 
66  protected $description = null;
67 
73  protected $extensionDownloadCounter = null;
74 
80  protected $extensionKey = null;
81 
87  protected $lastuploaddate = null;
88 
94  protected $ownerusername = null;
95 
101  protected $reviewstate = null;
102 
108  protected $state = null;
109 
115  protected $t3xfilemd5 = null;
116 
122  protected $title = null;
123 
129  protected $uploadcomment = null;
130 
136  protected $version = null;
137 
143  protected $versionDownloadCounter = null;
144 
157  public function getAll()
158  {
159  $versionProperties = [];
160  $versionProperties['extkey'] = $this->extensionKey;
161  $versionProperties['version'] = $this->version;
162  $versionProperties['alldownloadcounter'] = $this->extensionDownloadCounter;
163  $versionProperties['downloadcounter'] = $this->versionDownloadCounter;
164  $versionProperties['title'] = $this->title;
165  $versionProperties['description'] = $this->description;
166  $versionProperties['state'] = $this->state;
167  $versionProperties['reviewstate'] = $this->reviewstate;
168  $versionProperties['category'] = $this->category;
169  $versionProperties['lastuploaddate'] = $this->lastuploaddate;
170  $versionProperties['uploadcomment'] = $this->uploadcomment;
171  $versionProperties['dependencies'] = $this->dependencies;
172  $versionProperties['authorname'] = $this->authorname;
173  $versionProperties['authoremail'] = $this->authoremail;
174  $versionProperties['authorcompany'] = $this->authorcompany;
175  $versionProperties['ownerusername'] = $this->ownerusername;
176  $versionProperties['t3xfilemd5'] = $this->t3xfilemd5;
177  return $versionProperties;
178  }
179 
187  public function getAlldownloadcounter()
188  {
190  }
191 
199  public function getAuthorcompany()
200  {
201  return $this->authorcompany;
202  }
203 
211  public function getAuthoremail()
212  {
213  return $this->authoremail;
214  }
215 
223  public function getAuthorname()
224  {
225  return $this->authorname;
226  }
227 
235  public function getCategory()
236  {
237  return $this->category;
238  }
239 
247  public function getDependencies()
248  {
249  return $this->dependencies;
250  }
251 
259  public function getDescription()
260  {
261  return $this->description;
262  }
263 
271  public function getDownloadcounter()
272  {
274  }
275 
283  public function getExtkey()
284  {
285  return $this->extensionKey;
286  }
287 
295  public function getLastuploaddate()
296  {
297  return $this->lastuploaddate;
298  }
299 
307  public function getOwnerusername()
308  {
309  return $this->ownerusername;
310  }
311 
319  public function getReviewstate()
320  {
321  return $this->reviewstate;
322  }
323 
331  public function getState()
332  {
333  return $this->state;
334  }
335 
343  public function getT3xfilemd5()
344  {
345  return $this->t3xfilemd5;
346  }
347 
355  public function getTitle()
356  {
357  return $this->title;
358  }
359 
367  public function getUploadcomment()
368  {
369  return $this->uploadcomment;
370  }
371 
379  public function getVersion()
380  {
381  return $this->version;
382  }
383 
391  protected function resetProperties($resetAll = false)
392  {
393  // resetting at least class property "version" is mandatory
394  // as we need to do some magic in regards to
395  // an extension's and version's child node "downloadcounter"
396  $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;
397  if ($resetAll) {
398  $this->extensionKey = $this->extensionDownloadCounter = null;
399  }
400  }
401 
408  protected function convertDependencies($dependencies)
409  {
410  $newDependencies = [];
411  $dependenciesArray = unserialize($dependencies);
412  if (is_array($dependenciesArray)) {
413  foreach ($dependenciesArray as $version) {
414  if (!empty($version['kind']) && !empty($version['extensionKey'])) {
415  $newDependencies[$version['kind']][$version['extensionKey']] = $version['versionRange'];
416  }
417  }
418  }
419  return serialize($newDependencies);
420  }
421 }