1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* HtImgModule Configuration |
5
|
|
|
* |
6
|
|
|
* If you have a ./config/autoload/ directory set up for your project, you can |
7
|
|
|
* drop this config file in it and change the values as you wish. |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
$options = [ |
11
|
|
|
/** |
12
|
|
|
* Enable Cache |
13
|
|
|
* |
14
|
|
|
* Whether or not to cache image in public path, |
15
|
|
|
* so that Apache(or whatever) can directly get image |
16
|
|
|
* This can improve a lot of performance |
17
|
|
|
* |
18
|
|
|
* Default: true |
19
|
|
|
* Accepted values: boolean |
20
|
|
|
*/ |
21
|
|
|
// 'enable_cache' => true, |
|
|
|
|
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* Image Source Path Stack |
25
|
|
|
* |
26
|
|
|
* Folders where to look for the requested file (similiar to Zend Framework 2 template path stack) |
27
|
|
|
* |
28
|
|
|
* Default: Empty array|array() |
29
|
|
|
* Accepted values: array containing folders or directories |
30
|
|
|
*/ |
31
|
|
|
//'img_source_path_stack' => ['data/images/'], |
|
|
|
|
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* Image Source Map |
35
|
|
|
* |
36
|
|
|
* Exact path to image (similiar to Zend Framework 2 template map) |
37
|
|
|
* |
38
|
|
|
* Default: Empty array|array() |
39
|
|
|
* Accepted values: array containing key as image relative path and value as image real path |
40
|
|
|
*/ |
41
|
|
|
//'img_source_map' => array('hello/world.png' => 'data/img/hello/world.png'), |
|
|
|
|
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Imagine Driver |
45
|
|
|
* |
46
|
|
|
* Default: gd |
47
|
|
|
* Accepted values: one of gd, imagick or gmagick |
48
|
|
|
* It is registered as service which you can obtain throught ServiceLocator aware classes with: |
49
|
|
|
* $imagine = $this->getServiceLocator()->get('HtImg\Imagine'); |
50
|
|
|
*/ |
51
|
|
|
//'driver' => 'gd', |
|
|
|
|
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* Filters which can be accessed through view helper, 'imgUrl' easily |
55
|
|
|
*/ |
56
|
|
|
//'filters' => [], |
|
|
|
|
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Web Root |
60
|
|
|
* |
61
|
|
|
* Default: public (For Zend Skeleton Application) |
62
|
|
|
*/ |
63
|
|
|
//'web_root' => 'public_html', |
|
|
|
|
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Cache Path(Relative to web root) |
67
|
|
|
* |
68
|
|
|
* Default: htimg |
69
|
|
|
*/ |
70
|
|
|
//'cache_path' => 'htimg' |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Filter Loaders |
74
|
|
|
*/ |
75
|
|
|
//'filter_loaders' => [], |
|
|
|
|
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Cache Expiry |
79
|
|
|
* |
80
|
|
|
* Interval in seconds after which a cached image will expire and new cache is to be created |
81
|
|
|
* |
82
|
|
|
* Default: 86400 (1 day) |
83
|
|
|
* Accepted value: Integer |
84
|
|
|
*/ |
85
|
|
|
//'cache_expiry' => 86400 |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Default Image Loader |
89
|
|
|
* |
90
|
|
|
* Image Loader determines how to load a image for a "filter" |
91
|
|
|
* This option means the default image loader(for all filters) |
92
|
|
|
* Please see the docs for creating a custom image loader |
93
|
|
|
*/ |
94
|
|
|
// 'default_image_loader' => 'FileSystem', |
|
|
|
|
95
|
|
|
]; |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* You do not need to edit below this line |
99
|
|
|
*/ |
100
|
|
|
return [ |
101
|
|
|
'htimg' => $options |
102
|
|
|
]; |
103
|
|
|
|
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.