TYPO3 CMS  TYPO3_6-2
DownloadQueue.php
Go to the documentation of this file.
1 <?php
3 
18 
25 
31  protected $extensionStorage = array();
32 
38  protected $extensionInstallStorage = array();
39 
45  protected $extensionCopyStorage = array();
46 
51  protected $listUtility;
52 
63  public function addExtensionToQueue(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension, $stack = 'download') {
64  if (!is_string($stack) || !in_array($stack, array('download', 'update'))) {
65  throw new ExtensionManagerException('Stack has to be either "download" or "update"', 1342432103);
66  }
67  if (!isset($this->extensionStorage[$stack])) {
68  $this->extensionStorage[$stack] = array();
69  }
70  if (array_key_exists($extension->getExtensionKey(), $this->extensionStorage[$stack])) {
71  if ($this->extensionStorage[$stack][$extension->getExtensionKey()] !== $extension) {
72  throw new ExtensionManagerException(
73  $extension->getExtensionKey() . ' was requested to be downloaded in different versions (' . $extension->getVersion()
74  . ' and ' . $this->extensionStorage[$stack][$extension->getExtensionKey()]->getVersion() . ').',
75  1342432101
76  );
77  }
78  }
79  $this->extensionStorage[$stack][$extension->getExtensionKey()] = $extension;
80  }
81 
85  public function getExtensionQueue() {
87  }
88 
97  public function removeExtensionFromQueue(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension, $stack = 'download') {
98  if (!is_string($stack) || !in_array($stack, array('download', 'update'))) {
99  throw new ExtensionManagerException('Stack has to be either "download" or "update"', 1342432104);
100  }
101  if (array_key_exists($stack, $this->extensionStorage) && is_array($this->extensionStorage[$stack])) {
102  if (array_key_exists($extension->getExtensionKey(), $this->extensionStorage[$stack])) {
103  unset($this->extensionStorage[$stack][$extension->getExtensionKey()]);
104  }
105  }
106  }
107 
114  public function addExtensionToInstallQueue($extension) {
115  $this->extensionInstallStorage[$extension->getExtensionKey()] = $extension;
116  }
117 
124  public function removeExtensionFromInstallQueue($extensionKey) {
125  if (array_key_exists($extensionKey, $this->extensionInstallStorage)) {
126  unset($this->extensionInstallStorage[$extensionKey]);
127  }
128  }
129 
137  public function addExtensionToCopyQueue($extensionKey, $sourceFolder) {
138  $this->extensionCopyStorage[$extensionKey] = $sourceFolder;
139  }
140 
147  public function removeExtensionFromCopyQueue($extensionKey) {
148  if (array_key_exists($extensionKey, $this->extensionCopyStorage)) {
149  unset($this->extensionCopyStorage[$extensionKey]);
150  }
151  }
152 
158  public function getExtensionInstallStorage() {
160  }
161 
167  public function getExtensionCopyStorage() {
169  }
170 
171 }
addExtensionToQueue(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension, $stack='download')
removeExtensionFromQueue(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension, $stack='download')