|
@@ -44,7 +44,7 @@ discard block |
|
|
block discarded – undo |
|
44
|
44
|
|
|
45
|
45
|
$this->userInteractionHandler = $userInteractionHandler; |
|
46
|
46
|
|
|
47
|
|
- $this->date_format = $this->modx->getOption('manager_date_format') .', '. $this->modx->getOption('manager_time_format'); |
|
|
47
|
+ $this->date_format = $this->modx->getOption('manager_date_format').', '.$this->modx->getOption('manager_time_format'); |
|
48
|
48
|
} |
|
49
|
49
|
|
|
50
|
50
|
// Code ideas for MODX packages from: core/model/modx/processors/workspace/packages/getlist.class.php and |
|
@@ -56,7 +56,7 @@ discard block |
|
|
block discarded – undo |
|
56
|
56
|
* @param string $search |
|
57
|
57
|
* @return array |
|
58
|
58
|
*/ |
|
59
|
|
- public function getList($limit=25, $start=0, $search='') { |
|
|
59
|
+ public function getList($limit = 25, $start = 0, $search = '') { |
|
60
|
60
|
$data = [ |
|
61
|
61
|
'limit' => $limit, |
|
62
|
62
|
'packages' => [], |
|
@@ -122,7 +122,7 @@ discard block |
|
|
block discarded – undo |
|
122
|
122
|
* @return bool |
|
123
|
123
|
* @throws TransportException |
|
124
|
124
|
*/ |
|
125
|
|
- public function unInstallPackage($signature, $preexisting_mode=xPDOTransport::REMOVE_PREEXISTING) |
|
|
125
|
+ public function unInstallPackage($signature, $preexisting_mode = xPDOTransport::REMOVE_PREEXISTING) |
|
126
|
126
|
{ |
|
127
|
127
|
$package = $this->modx->getObject('transport.modTransportPackage', [ |
|
128
|
128
|
'signature' => $signature, |
|
@@ -153,7 +153,7 @@ discard block |
|
|
block discarded – undo |
|
153
|
153
|
* @throws TransportException |
|
154
|
154
|
* @throws TransportNotFoundException |
|
155
|
155
|
*/ |
|
156
|
|
- public function requirePackage($signature, $latest_version=true, $provider_name='modx.com') |
|
|
156
|
+ public function requirePackage($signature, $latest_version = true, $provider_name = 'modx.com') |
|
157
|
157
|
{ |
|
158
|
158
|
$package = $this->modx->getObject('transport.modTransportPackage', [ |
|
159
|
159
|
'signature' => $signature, |
|
@@ -217,7 +217,7 @@ discard block |
|
|
block discarded – undo |
|
217
|
217
|
* @throws TransportNotFoundException |
|
218
|
218
|
* @return bool|modTransportPackage |
|
219
|
219
|
*/ |
|
220
|
|
- protected function downloadPackageFiles($signature, modTransportProvider $provider, $latest=true) |
|
|
220
|
+ protected function downloadPackageFiles($signature, modTransportProvider $provider, $latest = true) |
|
221
|
221
|
{ |
|
222
|
222
|
$transfer_options = []; |
|
223
|
223
|
|
|
@@ -242,7 +242,7 @@ discard block |
|
|
block discarded – undo |
|
242
|
242
|
|
|
243
|
243
|
$this->possible_package_signatures = $provider->find(['query' => $parts['base']]); |
|
244
|
244
|
|
|
245
|
|
- throw new TransportNotFoundException('Failed to download package ' . $signature. |
|
|
245
|
+ throw new TransportNotFoundException('Failed to download package '.$signature. |
|
246
|
246
|
' from the '.$provider->get('name').' transport provider. Verify the signature and provider'); |
|
247
|
247
|
} |
|
248
|
248
|
|
|
@@ -261,7 +261,7 @@ discard block |
|
|
block discarded – undo |
|
261
|
261
|
$this->modx->cacheManager->refresh(); |
|
262
|
262
|
|
|
263
|
263
|
if (!$installed) { |
|
264
|
|
- throw new TransportException('Failed to install package ' . $package->signature); |
|
|
264
|
+ throw new TransportException('Failed to install package '.$package->signature); |
|
265
|
265
|
} |
|
266
|
266
|
|
|
267
|
267
|
$this->userInteractionHandler->tellUser('Extra '.$package->get('signature').' has been installed!', userInteractionHandler::MASSAGE_ERROR); |
|
@@ -303,7 +303,7 @@ discard block |
|
|
block discarded – undo |
|
303
|
303
|
$packageArray['updated'] = ''; |
|
304
|
304
|
} |
|
305
|
305
|
|
|
306
|
|
- $packageArray['created']= utf8_encode(date($this->date_format, strtotime($packageArray['created']))); |
|
|
306
|
+ $packageArray['created'] = utf8_encode(date($this->date_format, strtotime($packageArray['created']))); |
|
307
|
307
|
|
|
308
|
308
|
if ($packageArray['installed'] == null || $packageArray['installed'] == '0000-00-00 00:00:00') { |
|
309
|
309
|
$packageArray['installed'] = null; |
|
@@ -323,7 +323,7 @@ discard block |
|
|
block discarded – undo |
|
323
|
323
|
'count' => 0, |
|
324
|
324
|
'versions' => [] |
|
325
|
325
|
]; |
|
326
|
|
- if ($package->get('provider') > 0 && $this->modx->getOption('auto_check_pkg_updates',null,false)) { |
|
|
326
|
+ if ($package->get('provider') > 0 && $this->modx->getOption('auto_check_pkg_updates', null, false)) { |
|
327
|
327
|
$updateCacheKey = 'mgr/providers/updates/'.$package->get('provider').'/'.$package->get('signature'); |
|
328
|
328
|
$updateCacheOptions = array( |
|
329
|
329
|
xPDO::OPT_CACHE_KEY => $this->modx->cacheManager->getOption('cache_packages_key', null, 'packages'), |
|
@@ -401,7 +401,7 @@ discard block |
|
|
block discarded – undo |
|
401
|
401
|
* @param string $name |
|
402
|
402
|
* @return bool|modTransportProvider |
|
403
|
403
|
*/ |
|
404
|
|
- protected function getProvider($name='modx.com') |
|
|
404
|
+ protected function getProvider($name = 'modx.com') |
|
405
|
405
|
{ |
|
406
|
406
|
if (isset($this->provider_map[$name]) && $this->providerCache[$this->provider_map[$name]]) { |
|
407
|
407
|
return $this->providerCache[$this->provider_map[$name]]; |