Example #1
0
 /**
  * Get full publish configuration
  * @param  \Cms\Data\Website $website
  * @return array
  */
 public function getPublishData($website)
 {
     $publishData = json_decode($website->getPublish(), true);
     // use default publish data
     if (!is_array($publishData) || count($publishData) <= 0) {
         $publishData = $this->getDefaultPublishData();
     }
     // add the website domain for live hosting (this should not be overwritten by user input)
     if ($publishData['type'] === 'internal') {
         $publishData['domain'] = $this->getInternalLiveDomainName($website);
     } else {
         // add default ports for ftp/sftp
         if (isset($publishData['protocol']) && (!isset($publishData['port']) || !$publishData['port'])) {
             if ($publishData['protocol'] === 'ftp') {
                 $publishData['port'] = 21;
             } elseif ($publishData['protocol'] === 'sftp') {
                 $publishData['port'] = 22;
             }
         }
     }
     // default config from configuration files
     $publishDefaultData = $this->getDefaultPublishData($publishData['type']);
     return array_replace_recursive($publishDefaultData, $publishData);
 }
Example #2
0
 /**
  * Gibt das Password aus dem Daten Objekt zurueck
  *
  * @param \Cms\Data\Website $website
  * @return  string
  */
 protected function getPasswordFromOrm(\Cms\Data\Website $website)
 {
     $publishData = $website->getPublish();
     $publishArr = \Zend_Json::decode($publishData);
     if (isset($publishArr['password'])) {
         return $publishArr['password'];
     } else {
         return '';
     }
 }
Example #3
0
 protected function setValuesFromData(WebsiteData $data)
 {
     $this->setId($data->getId());
     $this->setName($data->getName());
     $this->setDescription($data->getDescription());
     $this->setNavigation($data->getNavigation());
     $this->setPublishingEnabled($data->getPublishingEnabled());
     $this->setPublish(\Zend_Json::decode($data->getPublish()));
     $this->setColorscheme(\Zend_Json::decode($data->getColorscheme()));
     $this->setResolutions(\Zend_Json::decode($data->getResolutions(), \Zend_Json::TYPE_OBJECT));
     $this->setVersion($data->getVersion());
     $this->setScreenshot();
     $this->setHome($data->getHome());
 }
Example #4
0
 /**
  * Get full publish configuration
  *
  * @param  \Cms\Data\Website $website
  *
  * @return array
  */
 public function getPublishData($website)
 {
     $publishData = json_decode($website->getPublish(), true);
     // use default publish data
     if (!is_array($publishData) || count($publishData) <= 0) {
         $publishData = $this->getDefaultPublishData();
     }
     // this should not be overwritten by user input
     $publishData['shortId'] = $website->getShortId();
     // default config from configuration files
     $publishDefaultData = $this->getDefaultPublishData($publishData['type']);
     return array_replace_recursive($publishDefaultData, $publishData);
 }