‪TYPO3CMS  10.4
AbstractExtensionXmlParser.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
23 {
29  protected ‪$authorcompany;
30 
36  protected ‪$authoremail;
37 
43  protected ‪$authorname;
44 
50  protected ‪$category;
51 
57  protected ‪$dependencies;
58 
64  protected ‪$description;
65 
72 
78  protected ‪$extensionKey;
79 
85  protected ‪$lastuploaddate;
86 
92  protected ‪$ownerusername;
93 
99  protected ‪$reviewstate;
100 
106  protected ‪$state;
107 
113  protected ‪$t3xfilemd5;
114 
120  protected ‪$title;
121 
127  protected ‪$uploadcomment;
128 
134  protected ‪$version;
135 
141  protected ‪$versionDownloadCounter;
142 
148  protected ‪$documentationLink;
149 
160  public function ‪getAll()
161  {
162  $versionProperties = [];
163  $versionProperties['extkey'] = ‪$this->extensionKey;
164  $versionProperties['version'] = ‪$this->version;
165  $versionProperties['alldownloadcounter'] = ‪$this->extensionDownloadCounter;
166  $versionProperties['downloadcounter'] = ‪$this->versionDownloadCounter;
167  $versionProperties['title'] = ‪$this->title;
168  $versionProperties['description'] = ‪$this->description;
169  $versionProperties['state'] = ‪$this->state;
170  $versionProperties['reviewstate'] = ‪$this->reviewstate;
171  $versionProperties['category'] = ‪$this->category;
172  $versionProperties['lastuploaddate'] = ‪$this->lastuploaddate;
173  $versionProperties['uploadcomment'] = ‪$this->uploadcomment;
174  $versionProperties['dependencies'] = ‪$this->dependencies;
175  $versionProperties['authorname'] = ‪$this->authorname;
176  $versionProperties['authoremail'] = ‪$this->authoremail;
177  $versionProperties['authorcompany'] = ‪$this->authorcompany;
178  $versionProperties['ownerusername'] = ‪$this->ownerusername;
179  $versionProperties['t3xfilemd5'] = ‪$this->t3xfilemd5;
180  $versionProperties['documentationlink'] = ‪$this->documentationLink;
181  return $versionProperties;
182  }
183 
190  public function ‪getAlldownloadcounter()
191  {
193  }
194 
201  public function ‪getAuthorcompany()
202  {
204  }
205 
212  public function ‪getAuthoremail()
213  {
214  return ‪$this->authoremail;
215  }
216 
223  public function ‪getAuthorname()
224  {
225  return ‪$this->authorname;
226  }
227 
234  public function ‪getCategory()
235  {
236  return ‪$this->category;
237  }
238 
245  public function ‪getDependencies()
246  {
247  return ‪$this->dependencies;
248  }
249 
256  public function ‪getDescription()
257  {
258  return ‪$this->description;
259  }
260 
267  public function ‪getDownloadcounter()
268  {
270  }
271 
278  public function ‪getExtkey()
279  {
280  return ‪$this->extensionKey;
281  }
282 
289  public function ‪getLastuploaddate()
290  {
292  }
293 
300  public function ‪getOwnerusername()
301  {
303  }
304 
311  public function ‪getReviewstate()
312  {
313  return ‪$this->reviewstate;
314  }
315 
322  public function ‪getState()
323  {
324  return ‪$this->state;
325  }
326 
333  public function ‪getT3xfilemd5()
334  {
335  return ‪$this->t3xfilemd5;
336  }
337 
344  public function ‪getTitle()
345  {
346  return ‪$this->title;
347  }
348 
355  public function ‪getUploadcomment()
356  {
358  }
359 
366  public function ‪getVersion()
367  {
368  return ‪$this->version;
369  }
370 
374  public function ‪isValidVersionNumber(): bool
375  {
376  // Validate the version number, see `isValidVersionNumber` in TER API
377  return (bool)preg_match('/^(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})\.(0|[1-9]\d{0,2})$/', $this->version);
378  }
379 
383  public function ‪getDocumentationLink()
384  {
386  }
387 
393  protected function ‪resetProperties($resetAll = false)
394  {
395  // resetting at least class property "version" is mandatory
396  // as we need to do some magic in regards to
397  // an extension's and version's child node "downloadcounter"
398  $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 = $this->documentationLink = null;
399  if ($resetAll) {
400  $this->extensionKey = $this->extensionDownloadCounter = null;
401  }
402  }
403 
410  protected function ‪convertDependencies(‪$dependencies)
411  {
412  $newDependencies = [];
413  $dependenciesArray = unserialize(‪$dependencies, ['allowed_classes' => false]);
414  if (is_array($dependenciesArray)) {
415  foreach ($dependenciesArray as ‪$version) {
416  if (!empty(‪$version['kind']) && !empty(‪$version['extensionKey'])) {
417  $newDependencies[‪$version['kind']][‪$version['extensionKey']] = ‪$version['versionRange'];
418  }
419  }
420  }
421  return serialize($newDependencies);
422  }
423 }
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$description
‪string $description
Definition: AbstractExtensionXmlParser.php:58
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getAuthorname
‪string getAuthorname()
Definition: AbstractExtensionXmlParser.php:205
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$authoremail
‪string $authoremail
Definition: AbstractExtensionXmlParser.php:34
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$versionDownloadCounter
‪string $versionDownloadCounter
Definition: AbstractExtensionXmlParser.php:124
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getLastuploaddate
‪string getLastuploaddate()
Definition: AbstractExtensionXmlParser.php:271
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$extensionKey
‪string $extensionKey
Definition: AbstractExtensionXmlParser.php:70
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$lastuploaddate
‪string $lastuploaddate
Definition: AbstractExtensionXmlParser.php:76
‪TYPO3\CMS\Extensionmanager\Utility\Parser
Definition: AbstractExtensionXmlParser.php:16
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getState
‪string getState()
Definition: AbstractExtensionXmlParser.php:304
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$t3xfilemd5
‪string $t3xfilemd5
Definition: AbstractExtensionXmlParser.php:100
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\isValidVersionNumber
‪isValidVersionNumber()
Definition: AbstractExtensionXmlParser.php:356
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\convertDependencies
‪string convertDependencies($dependencies)
Definition: AbstractExtensionXmlParser.php:392
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getDownloadcounter
‪string getDownloadcounter()
Definition: AbstractExtensionXmlParser.php:249
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$uploadcomment
‪string $uploadcomment
Definition: AbstractExtensionXmlParser.php:112
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getAuthorcompany
‪string getAuthorcompany()
Definition: AbstractExtensionXmlParser.php:183
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$documentationLink
‪string $documentationLink
Definition: AbstractExtensionXmlParser.php:130
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$authorcompany
‪string $authorcompany
Definition: AbstractExtensionXmlParser.php:28
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$extensionDownloadCounter
‪string $extensionDownloadCounter
Definition: AbstractExtensionXmlParser.php:64
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getOwnerusername
‪string getOwnerusername()
Definition: AbstractExtensionXmlParser.php:282
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$authorname
‪string $authorname
Definition: AbstractExtensionXmlParser.php:40
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractXmlParser
Definition: AbstractXmlParser.php:23
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getAll
‪array getAll()
Definition: AbstractExtensionXmlParser.php:142
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getUploadcomment
‪string getUploadcomment()
Definition: AbstractExtensionXmlParser.php:337
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getCategory
‪string getCategory()
Definition: AbstractExtensionXmlParser.php:216
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser
Definition: AbstractExtensionXmlParser.php:23
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getT3xfilemd5
‪string getT3xfilemd5()
Definition: AbstractExtensionXmlParser.php:315
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$category
‪string $category
Definition: AbstractExtensionXmlParser.php:46
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$dependencies
‪string $dependencies
Definition: AbstractExtensionXmlParser.php:52
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getAuthoremail
‪string getAuthoremail()
Definition: AbstractExtensionXmlParser.php:194
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getReviewstate
‪string getReviewstate()
Definition: AbstractExtensionXmlParser.php:293
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\resetProperties
‪resetProperties($resetAll=false)
Definition: AbstractExtensionXmlParser.php:375
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getDescription
‪string getDescription()
Definition: AbstractExtensionXmlParser.php:238
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getAlldownloadcounter
‪string getAlldownloadcounter()
Definition: AbstractExtensionXmlParser.php:172
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$reviewstate
‪string $reviewstate
Definition: AbstractExtensionXmlParser.php:88
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getDependencies
‪string getDependencies()
Definition: AbstractExtensionXmlParser.php:227
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getVersion
‪string getVersion()
Definition: AbstractExtensionXmlParser.php:348
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getTitle
‪string getTitle()
Definition: AbstractExtensionXmlParser.php:326
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$version
‪string $version
Definition: AbstractExtensionXmlParser.php:118
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$title
‪string $title
Definition: AbstractExtensionXmlParser.php:106
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getDocumentationLink
‪string getDocumentationLink()
Definition: AbstractExtensionXmlParser.php:365
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$ownerusername
‪string $ownerusername
Definition: AbstractExtensionXmlParser.php:82
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\getExtkey
‪string getExtkey()
Definition: AbstractExtensionXmlParser.php:260
‪TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser\$state
‪string $state
Definition: AbstractExtensionXmlParser.php:94