Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
345 www 2
declare(strict_types = 1);
1 efrain 3
namespace LeadersLinked\Command;
4
 
5
use Symfony\Component\Console\Command\Command;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
use Laminas\Db\Adapter\AdapterInterface;
9
use Laminas\Log\LoggerInterface;
10
use Laminas\Mvc\I18n\Translator;
11
use LeadersLinked\Cache\CacheInterface;
324 www 12
use PHPMailer\PHPMailer\PHPMailer;
1 efrain 13
 
290 www 14
class TestCommand extends Command
1 efrain 15
{
345 www 16
 
1 efrain 17
    /**
18
     *
19
     * @var \Laminas\Db\Adapter\AdapterInterface
20
     */
21
    private $adapter;
345 www 22
 
1 efrain 23
    /**
24
     *
25
     * @var \LeadersLinked\Cache\CacheInterface
26
     */
27
    private $cache;
345 www 28
 
1 efrain 29
    /**
30
     *
31
     * @var \Laminas\Log\LoggerInterface
32
     */
33
    private $logger;
345 www 34
 
1 efrain 35
    /**
36
     *
37
     * @var array
38
     */
39
    private $config;
345 www 40
 
1 efrain 41
    /**
42
     *
43
     * @var \Laminas\Mvc\I18n\Translator
44
     */
45
    private $translator;
345 www 46
 
1 efrain 47
    /**
48
     *
49
     * @param \Laminas\Db\Adapter\AdapterInterface $adapter
50
     * @param \LeadersLinked\Cache\CacheInterface $cache
345 www 51
     * @param
52
     *            \Laminas\Log\LoggerInterface
1 efrain 53
     * @param array $config
54
     * @param \Laminas\Mvc\I18n\Translator $translator
55
     */
56
    public function __construct($adapter, $cache, $logger, $config, $translator)
57
    {
345 www 58
        $this->adapter = $adapter;
59
        $this->cache = $cache;
60
        $this->logger = $logger;
61
        $this->config = $config;
62
        $this->translator = $translator;
63
 
1 efrain 64
        parent::__construct();
65
    }
66
 
345 www 67
    protected function execute(InputInterface $input, OutputInterface $output): int
1 efrain 68
    {
69
        $output->writeln('Inicio del proceso');
345 www 70
 
324 www 71
        $phpMailer = new PHPMailer();
345 www 72
        $phpMailer->isSMTP();
324 www 73
 
345 www 74
        $phpMailer->addAddress('eyanezve@gmail.com', 'efrain yanez');
1 efrain 75
 
345 www 76
        $phpMailer->setFrom('no-reply@leaderslinked.com', 'LeadersLinked');
77
        $phpMailer->SMTPDebug = true;
78
        $phpMailer->Host = 'email-smtp.us-west-2.amazonaws.com';
79
        $phpMailer->Port = 587;
80
        $phpMailer->IsHTML(true);
81
        $phpMailer->SMTPAuth = true;
82
        $phpMailer->SMTPSecure = 'tls';
83
        $phpMailer->SMTPAuth = true;
84
        $phpMailer->Username = 'AKIA4A6EDNEWNODSDUKH';
85
        $phpMailer->Password = 'BDHVmeD2FVwHCF7ova0+eGcHQQ7fHbztIV9mrevubKgc';
86
        $phpMailer->Subject = 'Asunto de prueba';
87
        $phpMailer->Body = 'Mensaje de Prueba';
88
        $phpMailer->AltBody = 'Mensaje de Prueba';
89
        $phpMailer->CharSet = 'UTF-8';
1 efrain 90
 
345 www 91
        $result = $phpMailer->send();
1 efrain 92
 
345 www 93
        print_r($result);
94
 
95
        /*
96
         * $source = 'data/background-61af7d08d1156.png';
97
         * $target_path = 'test';
98
         * $target_code = '001';
99
         * $target_filename = 'background-61af7d08d1156.png';
100
         * $target_width = 300;
101
         * $target_height = 300;
102
         * $crop_to_dimensions = false;
103
         * $unlink_source = false;
104
         *
105
         * $image = \LeadersLinked\Library\Image::getInstance($this->config);
106
         * $response = $image->uploadProcessChangeSize($source, $target_path, $target_code, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source);
107
         *
108
         *
109
         *
110
         * $output->writeln('Fin del proceso');
111
         *
112
         * print_r($response);
113
         */
114
 
1 efrain 115
        return 0;
116
    }
324 www 117
}