Esempio n. 1
0
 /**
  * Sends report
  *
  * @return \Deployer'\Logger\Provider\Smtp
  */
 public function send()
 {
     foreach (array('host', 'port', 'encryption', 'username', 'password', 'subject', 'from') as $param) {
         $this->_params[$param] = \Deployer::applyGlobalParams($this->_params[$param]);
     }
     try {
         $transport = \Swift_SmtpTransport::newInstance($this->param('host'), $this->param('port'), $this->param('encryption'))->setUsername($this->param('username'))->setPassword($this->param('password'));
         $mailer = \Swift_Mailer::newInstance($transport);
         $message = \Swift_Message::newInstance()->setSubject($this->param('subject'))->setFrom($this->param('from'))->addPart($this->data(), $this->mime());
         foreach ($this->param('to') as $to) {
             $message->setTo(\Deployer::applyGlobalParams($to));
         }
         $report = sptintf('email sent to %d recipients: %s', sizeof($this->param('to')), implode(', ', $this->param('to')));
     } catch (\Exception $e) {
         throw new \Deployer\ReportProviderException($e->getMessage());
     }
     if (!$mailer->send($message)) {
         throw new \Deployer\ReportProviderException('mail not sent');
     }
     if (!empty($report)) {
         return $this->report($report);
     }
     return $this;
 }
Esempio n. 2
0
 /**
  * Get all page of PDF and convert them to the png
  * @return array
  * @throws AM_Model_Db_StaticPdf_Data_Exception
  */
 public function getAllPagesThumbnails()
 {
     $sResource = $this->_sResourceDir . DIRECTORY_SEPARATOR . $this->getResourceBaseName();
     $oImageSource = AM_Resource_Factory::create($sResource);
     if (!$oImageSource instanceof AM_Resource_Concrete_Pdf) {
         throw new AM_Model_Db_StaticPdf_Data_Exception(sptintf('Wrong resource given "%s". Must be a PDF resource', $sResource));
     }
     $aFiles = $oImageSource->getAllPagesThumbnails();
     return $aFiles;
 }
Esempio n. 3
0
 /**
  * Get first page of PDF file and conver it the PNG
  * @return string
  * @throws AM_Model_Db_IssueHelpPage_Data_Exception
  */
 public function getFirstPageAsPng()
 {
     $sResource = $this->_sResourceDir . DIRECTORY_SEPARATOR . $this->getResourceBaseName();
     $oImageSource = AM_Resource_Factory::create($sResource);
     if (!$oImageSource instanceof AM_Resource_Concrete_Pdf) {
         throw new AM_Model_Db_IssueHelpPage_Data_Exception(sptintf('Wrong resource given "%s". Must be a PDF resource', $sResource));
     }
     $sFirstPagePath = $oImageSource->getFileForThumbnail();
     return $sFirstPagePath;
 }
Esempio n. 4
0
 function congrats()
 {
     echo '<h1>' . __('Congratulations!') . '</h1><p>' . __('Now that you have imported your Blogger blog into WordPress, what are you going to do? Here are some suggestions:') . '</p><ul><li>' . __('That was hard work! Take a break.') . '</li>';
     if (count($this->import['blogs']) > 1) {
         echo '<li>' . __('In case you haven\'t done it already, you can import the posts from your other blogs:') . $this->show_blogs() . '</li>';
     }
     if ($n = count($this->import['blogs'][$_GET['blog']]['newusers'])) {
         echo '<li>' . sptintf(__('Go to <a href="%s" target="%s">Authors &amp; Users</a>, where you can modify the new user(s) or delete them. If you want to make all of the imported posts yours, you will be given that option when you delete the new authors.'), 'users.php', '_parent') . '</li>';
     }
     echo '<li>' . __('For security, click the link below to reset this importer. That will clear your Blogger credentials and options from the database.') . '</li>';
     echo '</ul>';
 }