Proyectos de Subversion LeadersLinked - Services

Rev

Rev 334 | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

<?php
declare(strict_types = 1);
namespace LeadersLinked\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Laminas\Db\Adapter\AdapterInterface;
use Laminas\Log\LoggerInterface;
use Laminas\Mvc\I18n\Translator;
use LeadersLinked\Cache\CacheInterface;
use PHPMailer\PHPMailer\PHPMailer;

class TestCommand extends Command
{

    /**
     *
     * @var \Laminas\Db\Adapter\AdapterInterface
     */
    private $adapter;

    /**
     *
     * @var \LeadersLinked\Cache\CacheInterface
     */
    private $cache;

    /**
     *
     * @var \Laminas\Log\LoggerInterface
     */
    private $logger;

    /**
     *
     * @var array
     */
    private $config;

    /**
     *
     * @var \Laminas\Mvc\I18n\Translator
     */
    private $translator;

    /**
     *
     * @param \Laminas\Db\Adapter\AdapterInterface $adapter
     * @param \LeadersLinked\Cache\CacheInterface $cache
     * @param
     *            \Laminas\Log\LoggerInterface
     * @param array $config
     * @param \Laminas\Mvc\I18n\Translator $translator
     */
    public function __construct($adapter, $cache, $logger, $config, $translator)
    {
        $this->adapter = $adapter;
        $this->cache = $cache;
        $this->logger = $logger;
        $this->config = $config;
        $this->translator = $translator;

        parent::__construct();
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $output->writeln('Inicio del proceso');

        $phpMailer = new PHPMailer();
        $phpMailer->isSMTP();

        $phpMailer->addAddress('eyanezve@gmail.com', 'efrain yanez');

        $phpMailer->setFrom('no-reply@leaderslinked.com', 'LeadersLinked');
        $phpMailer->SMTPDebug = true;
        $phpMailer->Host = 'email-smtp.us-west-2.amazonaws.com';
        $phpMailer->Port = 587;
        $phpMailer->IsHTML(true);
        $phpMailer->SMTPAuth = true;
        $phpMailer->SMTPSecure = 'tls';
        $phpMailer->SMTPAuth = true;
        $phpMailer->Username = 'AKIA4A6EDNEWNODSDUKH';
        $phpMailer->Password = 'BDHVmeD2FVwHCF7ova0+eGcHQQ7fHbztIV9mrevubKgc';
        $phpMailer->Subject = 'Asunto de prueba';
        $phpMailer->Body = 'Mensaje de Prueba';
        $phpMailer->AltBody = 'Mensaje de Prueba';
        $phpMailer->CharSet = 'UTF-8';

        $result = $phpMailer->send();

        print_r($result);

        /*
         * $source = 'data/background-61af7d08d1156.png';
         * $target_path = 'test';
         * $target_code = '001';
         * $target_filename = 'background-61af7d08d1156.png';
         * $target_width = 300;
         * $target_height = 300;
         * $crop_to_dimensions = false;
         * $unlink_source = false;
         *
         * $image = \LeadersLinked\Library\Image::getInstance($this->config);
         * $response = $image->uploadProcessChangeSize($source, $target_path, $target_code, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source);
         *
         *
         *
         * $output->writeln('Fin del proceso');
         *
         * print_r($response);
         */

        return 0;
    }
}