public function process() { $attributes = array(); $attributesToGet = explode(',', $this->getProperty('attributes', '')); foreach ($attributesToGet as $attribute) { $attributes[$attribute] = $this->transport->getAttribute($attribute); /* if setup options, include setup file */ if ($attribute == 'setup-options') { @ob_start(); $options = $this->package->toArray(); $options[xPDOTransport::PACKAGE_ACTION] = $this->package->previousVersionInstalled() ? xPDOTransport::ACTION_UPGRADE : xPDOTransport::ACTION_INSTALL; $attributeFile = $this->modx->getOption('core_path') . 'packages/' . $this->package->signature . '/' . $attribute . '.php'; if (file_exists($attributeFile) && $attribute != '') { $modx =& $this->modx; $attributes['setup-options'] = (include $attributeFile); } @ob_end_clean(); } else { if (in_array($attribute, array('readme', 'license', 'changelog'))) { $attributes[$attribute] = htmlentities($attributes[$attribute], ENT_COMPAT, 'UTF-8'); } } } return $this->success('', $attributes); }
public function process() { $attributes = array(); $attributesToGet = explode(',', $this->getProperty('attributes', '')); foreach ($attributesToGet as $attribute) { $attributes[$attribute] = $this->transport->getAttribute($attribute); /* if setup options, include setup file */ if ($attribute == 'setup-options') { @ob_start(); $options = $this->package->toArray(); $options[xPDOTransport::PACKAGE_ACTION] = empty($this->package->installed) ? xPDOTransport::ACTION_INSTALL : xPDOTransport::ACTION_UPGRADE; $attributeFile = $this->modx->getOption('core_path') . 'packages/' . $this->package->signature . '/' . $attribute . '.php'; if (file_exists($attributeFile) && $attribute != '') { $modx =& $this->modx; $attributes['setup-options'] = (include $attributeFile); } @ob_end_clean(); } } return $this->success('', $attributes); }
public function process() { $requires = $this->transport->getAttribute('requires'); $dep = $this->package->checkDependencies($requires); $download = $this->package->checkDownloadedDependencies($dep); $returnArray = array(); foreach ($requires as $pkg => $constraints) { if (isset($dep[$pkg])) { $installed = false; } else { $installed = true; } if (isset($download[$pkg])) { $downloaded = true; $signature = $download[$pkg]; } else { $downloaded = false; $signature = ''; } //@TODO: Get downlaoded property properly from somewhere and add signature property that will be needed for running installation $returnArray[] = array('name' => $pkg, 'parentSignature' => $this->getProperty('signature'), 'constraints' => $constraints, 'installed' => $installed, 'downloaded' => $downloaded, 'signature' => $signature); } return $this->outputArray($returnArray, count($returnArray)); }