手册:$wgHashedUploadDirectory
| 文件及文件上传: $wgHashedUploadDirectory | |
|---|---|
当为true时,使用/a/ab/foo.jpg目录结构。 |
|
| 引进版本: | 1.4.0 (r5578) |
| 移除版本: | 仍在使用 |
| 允许的值: | (布尔值) |
| 默认值: | true |
| 其他设置: 按首字母排序 | 按功能排序 | |
详情
If true, uploaded files will be distributed into sub-directories of $wgUploadDirectory based on the first two characters of the md5 hash of the filename.
(e.g. $IP/images/a/ab/foo.jpg)
创建这样的子目录是自动处理的。
此设置用于避免在单个文件夹含有过多文件,因为部分文件系统难以在单个文件夹处理大量文件。
该算法基于文件名的MD5,先将第一个字符用于第一个目录,然后将前两个字符用于子目录。
Foo.png→ 文件名的MD5 =f865cbca12286c1c5b7616b4a70fbf68→ f + f8 = $IP/images/f/f8/Foo.png
If false, all images are uploaded in $wgUploadDirectory itself.
(e.g. $IP/images/foo.jpg)
This parameter should not be changed after the first image or file has been uploaded (or else you will need to move all previous uploaded pictures). It will result in PHP errors (see the discussion page) if articles with the old logic try to find their pictures, since the image path is calculated and not stored in the database.
如果设置了$wgLocalFileRepo,则此参数将被忽略。
参见
- $wgHashedSharedUploadDirectory — for shared uploads.
- $wgLocalFileRepo — for changing the hash level (number of characters used from the hash).