PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / mrclay / minify / lib / Minify / Controller / Base.php

Base.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 4.7.0, at vendor/mrclay/minify/lib/Minify/Controller/Base.php

82 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class Minify_Controller_Base
4 * @package Minify
5 */
6
7 use Psr\Log\LoggerInterface;
8 use Monolog\Logger;
9
10 /**
11 * Base class for Minify controller
12 *
13 * The controller class validates a request and uses it to create a configuration for Minify::serve().
14 *
15 * @package Minify
16 * @author Stephen Clay <[email protected]>
17 */
18 abstract class Minify_Controller_Base implements Minify_ControllerInterface
19 {
20
21 /**
22 * @var Minify_Env
23 */
24 protected $env;
25
26 /**
27 * @var Minify_Source_Factory
28 */
29 protected $sourceFactory;
30
31 /**
32 * @var LoggerInterface
33 */
34 protected $logger;
35
36 /**
37 * @param Minify_Env $env
38 * @param Minify_Source_Factory $sourceFactory
39 * @param LoggerInterface $logger
40 */
41 public function __construct(Minify_Env $env, Minify_Source_Factory $sourceFactory, LoggerInterface $logger = null)
42 {
43 $this->env = $env;
44 $this->sourceFactory = $sourceFactory;
45 if (!$logger) {
46 $logger = new Logger('minify');
47 }
48 $this->logger = $logger;
49 }
50
51 /**
52 * Create controller sources and options for Minify::serve()
53 *
54 * @param array $options controller and Minify options
55 *
56 * @return Minify_ServeConfiguration
57 */
58 abstract public function createConfiguration(array $options);
59
60 /**
61 * Send message to the Minify logger
62 *
63 * @param string $msg
64 *
65 * @return null
66 * @deprecated use $this->logger
67 */
68 public function log($msg)
69 {
70 trigger_error(__METHOD__ . ' is deprecated in Minify 3.0.', E_USER_DEPRECATED);
71 $this->logger->info($msg);
72 }
73
74 /**
75 * {@inheritdoc}
76 */
77 public function getEnv()
78 {
79 return $this->env;
80 }
81 }
82