Proyectos de Subversion LeadersLinked - Services

Rev

Rev 1 | Rev 324 | 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;
14
 
15
 
290 www 16
class TestCommand extends Command
1 efrain 17
{
18
    /**
19
     *
20
     * @var \Laminas\Db\Adapter\AdapterInterface
21
     */
22
    private $adapter;
23
 
24
    /**
25
     *
26
     * @var \LeadersLinked\Cache\CacheInterface
27
     */
28
    private $cache;
29
 
30
 
31
    /**
32
     *
33
     * @var \Laminas\Log\LoggerInterface
34
     */
35
    private $logger;
36
 
37
    /**
38
     *
39
     * @var array
40
     */
41
    private $config;
42
 
43
 
44
    /**
45
     *
46
     * @var \Laminas\Mvc\I18n\Translator
47
     */
48
    private $translator;
49
 
50
 
51
    /**
52
     *
53
     * @param \Laminas\Db\Adapter\AdapterInterface $adapter
54
     * @param \LeadersLinked\Cache\CacheInterface $cache
55
     * @param \Laminas\Log\LoggerInterface
56
     * @param array $config
57
     * @param \Laminas\Mvc\I18n\Translator $translator
58
     */
59
    public function __construct($adapter, $cache, $logger, $config, $translator)
60
    {
61
        $this->adapter      = $adapter;
62
        $this->cache        = $cache;
63
        $this->logger       = $logger;
64
        $this->config       = $config;
65
        $this->translator   = $translator;
66
 
67
        parent::__construct();
68
    }
69
 
70
 
71
    protected function execute(InputInterface $input, OutputInterface $output) : int
72
    {
73
        $output->writeln('Inicio del proceso');
74
 
290 www 75
        $source = 'data/background-61af7d08d1156.png';
76
        $target_path = 'test';
77
        $target_code = '001';
78
        $target_filename = 'background-61af7d08d1156.png';
79
        $target_width = 300;
80
        $target_height = 300;
81
        $crop_to_dimensions = false;
82
        $unlink_source = false;
83
 
84
        $image = \LeadersLinked\Library\Image::getInstance($this->config);
85
        $response = $image->uploadImageChangeSize($source, $target_path, $target_code, $target_filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source);
1 efrain 86
 
87
 
88
 
89
        $output->writeln('Fin del proceso');
90
 
290 www 91
        print_r($response);
92
 
1 efrain 93
        return 0;
94
    }
95
 
96
 
97
 
98
}