Mercurial > dirlist-php
annotate README.md @ 28:ce92f4d41714
Add support for displaying hidden files.
author | edogawaconan <me@myconan.net> |
---|---|
date | Thu, 30 Oct 2014 12:14:32 +0900 |
parents | f9588ccb7a42 |
children | e4f534198385 |
rev | line source |
---|---|
13
b6b65a5b9c1a
Change readme title and add note for apache.
edogawaconan <me@myconan.net>
parents:
12
diff
changeset
|
1 dirlist |
b6b65a5b9c1a
Change readme title and add note for apache.
edogawaconan <me@myconan.net>
parents:
12
diff
changeset
|
2 ======= |
1 | 3 |
4 Using capability of nginx. | |
5 | |
6 Basically, add this block | |
7 | |
8 location @lister { | |
10
47a281c1d54e
Update documentation to match current code.
edogawaconan <me@myconan.net>
parents:
1
diff
changeset
|
9 include fastcgi_params; |
1 | 10 fastcgi_pass unix:/tmp/php-fcgi.sock; |
24
f9588ccb7a42
Add note for optional parameter.
edogawaconan <me@myconan.net>
parents:
23
diff
changeset
|
11 |
f9588ccb7a42
Add note for optional parameter.
edogawaconan <me@myconan.net>
parents:
23
diff
changeset
|
12 // BEGIN -- only when using alias |
10
47a281c1d54e
Update documentation to match current code.
edogawaconan <me@myconan.net>
parents:
1
diff
changeset
|
13 uninitialized_variable_warn off; |
23
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
14 fastcgi_param DL_DIR $dl_dir; |
24
f9588ccb7a42
Add note for optional parameter.
edogawaconan <me@myconan.net>
parents:
23
diff
changeset
|
15 // END ---- only when using alias |
f9588ccb7a42
Add note for optional parameter.
edogawaconan <me@myconan.net>
parents:
23
diff
changeset
|
16 |
10
47a281c1d54e
Update documentation to match current code.
edogawaconan <me@myconan.net>
parents:
1
diff
changeset
|
17 fastcgi_param SCRIPT_FILENAME /path/to/index.php; |
1 | 18 } |
19 | |
23
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
20 (adjust the path to `index.php` and `php-fcgi`). |
1 | 21 |
23
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
22 And whenever a directory needs to be autoindexed, add |
1 | 23 |
10
47a281c1d54e
Update documentation to match current code.
edogawaconan <me@myconan.net>
parents:
1
diff
changeset
|
24 location / { |
47a281c1d54e
Update documentation to match current code.
edogawaconan <me@myconan.net>
parents:
1
diff
changeset
|
25 try_files $uri @lister; |
47a281c1d54e
Update documentation to match current code.
edogawaconan <me@myconan.net>
parents:
1
diff
changeset
|
26 } |
47a281c1d54e
Update documentation to match current code.
edogawaconan <me@myconan.net>
parents:
1
diff
changeset
|
27 |
23
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
28 . |
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
29 |
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
30 Note that if the directory is aliased, `$dl_dir` (fastcgi `DL_DIR`) needs to be set. |
10
47a281c1d54e
Update documentation to match current code.
edogawaconan <me@myconan.net>
parents:
1
diff
changeset
|
31 |
1 | 32 location /anime/win/ { |
23
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
33 set $dl_dir $request_filename; |
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
34 alias /srv/ftp/; |
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
35 try_files $uri @lister; // try_files "" @lister if the alias is |
1 | 36 } |
37 | |
23
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
38 And done. Probably also works with apache but I have no idea how to set it up. |
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
39 |
28
ce92f4d41714
Add support for displaying hidden files.
edogawaconan <me@myconan.net>
parents:
24
diff
changeset
|
40 Configurations |
ce92f4d41714
Add support for displaying hidden files.
edogawaconan <me@myconan.net>
parents:
24
diff
changeset
|
41 -------------- |
ce92f4d41714
Add support for displaying hidden files.
edogawaconan <me@myconan.net>
parents:
24
diff
changeset
|
42 |
ce92f4d41714
Add support for displaying hidden files.
edogawaconan <me@myconan.net>
parents:
24
diff
changeset
|
43 Here are some variables which changes how it behaves: |
ce92f4d41714
Add support for displaying hidden files.
edogawaconan <me@myconan.net>
parents:
24
diff
changeset
|
44 |
ce92f4d41714
Add support for displaying hidden files.
edogawaconan <me@myconan.net>
parents:
24
diff
changeset
|
45 - `DL_DIR`: sets directory to be listed. |
ce92f4d41714
Add support for displaying hidden files.
edogawaconan <me@myconan.net>
parents:
24
diff
changeset
|
46 - `DL_SHOWALL`: show or hide files which name start with `.`. Set to `1` to show. |
ce92f4d41714
Add support for displaying hidden files.
edogawaconan <me@myconan.net>
parents:
24
diff
changeset
|
47 |
23
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
48 Upgrading |
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
49 --------- |
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
50 |
949398173ecb
Much simpler setup with $request_filename.
edogawaconan <me@myconan.net>
parents:
13
diff
changeset
|
51 When upgrading from 1.0.0, update nginx config accordingly. |
12 | 52 |
53 License | |
54 ------- | |
55 | |
56 Copyright 2014 edogawaconan <me@myconan.net> | |
57 | |
58 Permission to use, copy, modify, and/or distribute this software for any | |
59 purpose with or without fee is hereby granted, provided that the above | |
60 copyright notice and this permission notice appear in all copies. | |
61 | |
62 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
63 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
64 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
65 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
66 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
67 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
68 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |