예제 #1
0
 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);
 }
예제 #2
0
 public function process()
 {
     $collection = array();
     $packageArray = $this->package->toArray();
     $installed = $this->package->get('installed');
     $packageArray['installed'] = $installed == null ? $this->modx->lexicon('no') : $installed;
     $collection[] = $packageArray;
     return $this->success('', $collection);
 }
예제 #3
0
 public function cleanup()
 {
     $this->getMetadata();
     $packageArray = $this->object->toArray();
     unset($packageArray['attributes']);
     unset($packageArray['metadata']);
     unset($packageArray['manifest']);
     $packageArray = $this->formatDates($packageArray);
     return $this->success('', $packageArray);
 }
예제 #4
0
 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);
 }