Completed
Push — master ( fb8b2d...704d46 )
by Sébastien
01:57
created

config_default.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * COPS (Calibre OPDS PHP Server) class file
4
 *
5
 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
6
 * @author     Sébastien Lucas <[email protected]>
7
 */
8
9
    if (!isset($config)) {
10
        $config = array();
11
    }
12
13
    /*
14
     * The directory containing calibre's metadata.db file, with sub-directories
15
     * containing all the formats.
16
     * BEWARE : it has to end with a /
17
     * You can enable multiple database with this notation instead of a simple string :
18
     * $config['calibre_directory'] = array ("My database name" => "/home/directory/calibre1/", "My other database name" => "/home/directory/calibre2/");
19
     */
20
    $config['calibre_directory'] = './';
21
22
    /*
23
     * SPECIFIC TO NGINX
24
     * The internal directory set in nginx config file
25
     * Leave empty if you don't know what you're doing
26
     */
27
    $config['calibre_internal_directory'] = '';
28
29
    /*
30
     * Full URL prefix (with trailing /)
31
     * useful especially for Opensearch where a full URL is often required
32
     * For example Mantano, Aldiko and Marvin require it.
33
     */
34
    $config['cops_full_url'] = '';
35
36
    /*
37
     * Number of recent books to show
38
     */
39
    $config['cops_recentbooks_limit'] = '50';
40
41
    /*
42
     * Catalog's author name
43
     */
44
    $config['cops_author_name'] = 'Sébastien Lucas';
45
46
    /*
47
     * Catalog's author uri
48
     */
49
    $config['cops_author_uri'] = 'http://blog.slucas.fr';
50
51
    /*
52
     * Catalog's author email
53
     */
54
    $config['cops_author_email'] = '[email protected]';
55
56
    /*
57
     * Catalog's title
58
     */
59
    $config['cops_title_default'] = 'COPS';
60
61
    /*
62
     * Catalog's subtitle
63
     */
64
    $config['cops_subtitle_default'] = '';
65
66
    /*
67
     * Wich header to use when downloading books outside the web directory
68
     * Possible values are :
69
     *   X-Accel-Redirect   : For Nginx
70
     *   X-Sendfile         : For Lightttpd or Apache (with mod_xsendfile)
71
     *   No value (default) : Let PHP handle the download
72
     */
73
    $config['cops_x_accel_redirect'] = '';
74
75
    /*
76
     * Height of thumbnail image for OPDS
77
     */
78
    $config['cops_opds_thumbnail_height'] = '164';
79
80
    /*
81
     * Height of thumbnail image for HTML
82
     */
83
    $config['cops_html_thumbnail_height'] = '164';
84
85
    /*
86
     * Icon for both OPDS and HTML catalog
87
     * Note that this has to be a real icon (.ico)
88
     */
89
    $config['cops_icon'] = 'favicon.ico';
90
91
    /*
92
     * Show icon for authors, series, tags and books on OPDS feed
93
     *  1 : enable
94
     *  0 : disable
95
     */
96
    $config['cops_show_icons'] = '1';
97
98
    /*
99
     * Default timezone
100
     * Check following link for other timezones :
101
     * http://www.php.net/manual/en/timezones.php
102
     */
103
    $config['default_timezone'] = 'Europe/Paris';
104
105
    /*
106
     * Prefered format for HTML catalog
107
     * The two first will be displayed in book entries
108
     * The other only appear in book detail
109
     */
110
    $config['cops_prefered_format'] = array('EPUB', 'PDF', 'AZW3', 'AZW', 'MOBI', 'CBR', 'CBZ');
111
112
    /*
113
     * use URL rewriting for downloading of ebook in HTML catalog
114
     * See Github wiki for more information
115
     *  1 : enable
116
     *  0 : disable
117
     */
118
    $config['cops_use_url_rewriting'] = '0';
119
120
    /*
121
     * generate a invalid OPDS stream to allow bad OPDS client to use search
122
     * Example of non compliant OPDS client : Moon+ Reader
123
     * Example of good OPDS client : Mantano, FBReader
124
     *  1 : enable support for non compliant OPDS client
125
     *  0 : always generate valid OPDS code
126
     */
127
    $config['cops_generate_invalid_opds_stream'] = '0';
128
129
    /*
130
     * Max number of items per page
131
     * -1 unlimited
132
     */
133
    $config['cops_max_item_per_page'] = '-1';
134
135
    /*
136
     * split authors by first letter
137
     * 1 : Yes
138
     * 0 : No
139
     */
140
    $config['cops_author_split_first_letter'] = '1';
141
142
    /*
143
     * split titles by first letter
144
     * 1 : Yes
145
     * 0 : No
146
     */
147
    $config['cops_titles_split_first_letter'] = '1';
148
149
    /*
150
     * Enable the Lightboxes (for popups)
151
     * 1 : Yes (enable)
152
     * 0 : No
153
     */
154
    $config['cops_use_fancyapps'] = '1';
155
156
    /*
157
     * Update Epub metadata before download
158
     * 1 : Yes (enable)
159
     * 0 : No
160
     */
161
    $config['cops_update_epub-metadata'] = '0';
162
163
    /*
0 ignored issues
show
Unused Code Comprehensibility introduced by
36% of this comment could be valid code. Did you maybe forget this after debugging?

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.

Loading history...
164
     * Filter on tags to book list
165
     * Only works with the OPDS catalog
166
     * Usage : array ("I only want to see books using the tag : Tag1"     => "Tag1",
167
     *                "I only want to see books not using the tag : Tag1" => "!Tag1",
168
     *                "I want to see every books"                         => "",
169
     *
170
     * Example : array ("All" => "", "Unread" => "!Read", "Read" => "Read")
171
     */
172
    $config['cops_books_filter'] = array();
173
174
    /*
175
     * Custom Columns for the index page
176
     * to add as an array containing the lookup names configured in Calibre
177
     *
178
     * For example : array ("genre", "mycolumn");
179
     *
180
     * Note that the composite custom columns are not supported
181
     */
182
    $config['cops_calibre_custom_column'] = array();
183
184
    /*
185
     * Custom Columns for the list representation
186
     * to add as an array containing the lookup names configured in Calibre
187
     *
188
     * For example : array ("genre", "mycolumn");
189
     *
190
     * Note that the composite custom columns are not supported
191
     */
192
    $config['cops_calibre_custom_column_list'] = array ();
193
194
    /*
195
     * Custom Columns for the book preview panel
196
     * to add as an array containing the lookup names configured in Calibre
197
     *
198
     * For example : array ("genre", "mycolumn");
199
     *
200
     * Note that the composite custom columns are not supported
201
     */
202
    $config['cops_calibre_custom_column_preview'] = array ();
203
204
    /*
205
     * Rename .epub to .kepub.epub if downloaded from a Kobo eReader
206
     * The ebook will then be recognized a Kepub so with chaptered paging, statistics, ...
207
     * You have to enable URL rewriting if you want to enable kepup.epub download
208
     * 1 : Yes (enable)
209
     * 0 : No
210
     */
211
    $config['cops_provide_kepub'] = '0';
212
213
    /*
214
     * Enable and configure Send To Kindle (or Email) feature.
215
     *
216
     * Don't forget to authorize the sender email you configured in your Kindle's  Approved Personal Document E-mail List.
217
     *
218
     * If you want to use a simple smtp server (provided by your ISP for example), you can configure it like that :
219
     * $config['cops_mail_configuration'] = array( "smtp.host"     => "smtp.free.fr",
220
     *                                           "smtp.username" => "",
221
     *                                           "smtp.password" => "",
222
     *                                           "smtp.secure"   => "",
223
     *                                           "address.from"  => "[email protected]"
224
     *                                           );
225
     *
226
     * For Gmail (ssl is mandatory) :
227
     * $config['cops_mail_configuration'] = array( "smtp.host"     => "smtp.gmail.com",
228
     *                                           "smtp.username" => "YOUR GMAIL ADRESS",
229
     *                                           "smtp.password" => "YOUR GMAIL PASSWORD",
230
     *                                           "smtp.secure"   => "ssl",
231
     *                                           "address.from"  => "[email protected]"
232
     *                                           );
233
     */
234
    $config['cops_mail_configuration'] = NULL;
235
236
    /*
237
     * Use filter in HTML catalog
238
     * 1 : Yes (enable)
239
     * 0 : No
240
     */
241
    $config['cops_html_tag_filter'] = '0';
242
243
    /*
244
     * Thumbnails are generated on-the-fly so it can be problematic on servers with slow CPU (Raspberry Pi, Dockstar, Piratebox, ...).
245
     * This configuration item allow to customize how thumbnail will be generated
246
     * "" : Generate thumbnail (CPU hungry)
247
     * "1" : always send the full size image (Network hungry)
248
     * any url : Send a constant image as the thumbnail (you can try "images/bookcover.png")
249
     */
250
    $config['cops_thumbnail_handling'] = '';
251
252
    /*
253
     * Directory to keep resized thumbnails: allow to resize thumbnails only on first access, then use this cache.
254
     * $config['cops_thumbnail_handling'] must be ""
255
     * "" : don't cache thumbnail
256
     * "/tmp/cache/" (example) : will generate thumbnails in /tmp/cache/
257
     * BEWARE : it has to end with a /
258
     */
259
    $config['cops_thumbnail_cache_directory'] = '';
260
261
    /*
262
     * Contains a list of user agent for browsers not compatible with client side rendering
263
     * For now : Kindle, Sony PRS-T1, Sony PRS-T2, All Cybook devices (maybe a little extreme).
264
     * This item is used as regular expression so "." will force server side rendering for all devices
265
     */
266
    $config['cops_server_side_render'] = 'Kindle\/1\.0|Kindle\/2\.0|Kindle\/3\.0|EBRD1101|EBRD1201|cybook';
267
268
    /*
269
     * Specify the ignored categories for the home screen and with search
270
     * Meaning that if you don't want to search in publishers or tags just add them from the list
271
     * Only accepted values :
272
     * - author
273
     * - book
274
     * - series
275
     * - tag
276
     * - publisher
277
     * - rating
278
     * - language
279
     */
280
    $config ['cops_ignored_categories'] = array();
281
282
    /*
283
     * If you use a Sony eReader or Aldiko you can't download ebooks if your catalog
284
     * is password protected. A simple workaround is to leave fetch.php not protected (see .htaccess).
285
     * But In that case your COPS installation is not completely safe.
286
     * Setting this parameter to "1" ensure that nobody can access fetch.php before accessing
287
     * index.php or feed.php first.
288
     * BEWARE : Do not touch this if you're not using password, not using PRS-TX or not using Aldiko.
289
     */
290
    $config ['cops_fetch_protect'] = '0';
291
292
    /*
293
     * WARNING NOT READY FOR PRODUCTION USE
294
     * Make the search better (don't care about diacritics, uppercase should work on Cyrillic) but slower.
295
     * 1 : Yes (enable)
296
     * 0 : No
297
     */
298
    $config ['cops_normalized_search'] = '0';
299
300
    /*
301
     * Enable PHP password protection (You can use if htpasswd is not possible for you)
302
     * If possible prefer htpasswd !
303
     * array( "username" => "xxx", "password" => "secret") : Enable PHP password protection
304
     * NULL : Disable PHP password protection (You can still use htpasswd)
305
     */
306
    $config['cops_basic_authentication'] = NULL;
307
308
    /*
309
     * Which template is used by default :
310
     * 'default'
311
     * 'bootstrap'
312
     */
313
    $config['cops_template'] = 'default';
314
315
    /*
316
     * Which style is used by default :
317
     * 'base'
318
     * 'default'
319
     * 'eink' (only available for the 'default' template)
320
     * 'iphone' (only available for the 'default' template)
321
     * 'iphone7' (only available for the 'default' template)
322
     */
323
    $config['cops_style'] = 'default';
324
325
    /*
326
     * Set language code to force a language (see lang/ directory for available languages).
327
     * When empty it will auto detect the language.
328
     */
329
    $config['cops_language'] = '';
330