|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* YAWIK |
|
4
|
|
|
* |
|
5
|
|
|
* @filesource |
|
6
|
|
|
* @license MIT |
|
7
|
|
|
* @copyright 2013 - 2016 Cross Solution <http://cross-solution.de> |
|
8
|
|
|
*/ |
|
9
|
|
|
namespace Organizations\Options; |
|
10
|
|
|
|
|
11
|
|
|
use Zend\Stdlib\AbstractOptions; |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Image file cache options |
|
15
|
|
|
* |
|
16
|
|
|
* @author Miroslav Fedeleš <[email protected]> |
|
17
|
|
|
* @since 0.28 |
|
18
|
|
|
*/ |
|
19
|
|
|
class ImageFileCacheOptions extends AbstractOptions |
|
20
|
|
|
{ |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Flag whether cache is enabled |
|
24
|
|
|
* |
|
25
|
|
|
* @var bool |
|
26
|
|
|
*/ |
|
27
|
|
|
protected $enabled = true; |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Path to the directory in a file system |
|
31
|
|
|
* |
|
32
|
|
|
* @var string |
|
33
|
|
|
*/ |
|
34
|
|
|
protected $filePath; |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* Path to the directory accessible via web server |
|
38
|
|
|
* |
|
39
|
|
|
* @var string |
|
40
|
|
|
*/ |
|
41
|
|
|
protected $uriPath = '/cache/Organizations/Image'; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @param array|Traversable|null $options |
|
45
|
|
|
*/ |
|
46
|
|
|
public function __construct($options = null) |
|
47
|
|
|
{ |
|
48
|
|
|
$this->filePath = __DIR__ . '/../../../../../public' . $this->uriPath; |
|
49
|
|
|
|
|
50
|
|
|
parent::__construct($options); |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @return bool |
|
55
|
|
|
*/ |
|
56
|
|
|
public function getEnabled() |
|
|
|
|
|
|
57
|
|
|
{ |
|
58
|
|
|
return $this->enabled; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
/** |
|
62
|
|
|
* @param bool $enabled |
|
63
|
|
|
* @return ImageFileCacheOptions |
|
64
|
|
|
*/ |
|
65
|
|
|
public function setEnabled($enabled) |
|
66
|
|
|
{ |
|
67
|
|
|
$this->enabled = $enabled; |
|
68
|
|
|
return $this; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* @return string |
|
73
|
|
|
*/ |
|
74
|
|
|
public function getFilePath() |
|
75
|
|
|
{ |
|
76
|
|
|
return $this->filePath; |
|
77
|
|
|
} |
|
78
|
|
|
|
|
79
|
|
|
/** |
|
80
|
|
|
* @param string $filePath |
|
81
|
|
|
* @return ImageFileCacheOptions |
|
82
|
|
|
*/ |
|
83
|
|
|
public function setFilePath($filePath) |
|
84
|
|
|
{ |
|
85
|
|
|
$this->filePath = $filePath; |
|
86
|
|
|
return $this; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* @return string |
|
91
|
|
|
*/ |
|
92
|
|
|
public function getUriPath() |
|
93
|
|
|
{ |
|
94
|
|
|
return $this->uriPath; |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
/** |
|
98
|
|
|
* @param string $uriPath |
|
99
|
|
|
* @return ImageFileCacheOptions |
|
100
|
|
|
*/ |
|
101
|
|
|
public function setUriPath($uriPath) |
|
102
|
|
|
{ |
|
103
|
|
|
$this->uriPath = $uriPath; |
|
104
|
|
|
return $this; |
|
105
|
|
|
} |
|
106
|
|
|
} |
|
107
|
|
|
|
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.