Proyectos de Subversion LeadersLinked - Services

Rev

Rev 290 | Rev 334 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

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