LogoLogo
  • Introduction
  • Installation
  • Upgrade Guide
  • Docker
  • Configuration
    • Configuration Overview
    • Configuration Reference
    • Hiding Files
  • Help & Support
    • Troubleshooting
    • Common Issues
  • Developers
    • Development Environment
Powered by GitBook
On this page
  • Bootstrap Configuration
  • FILES_PATH
  • COMPILE_CONTAINER
  • Runtime Configuration
  • analytics_file
  • date_format
  • debug
  • display_readmes
  • google_analytics_id
  • hidden_files_list
  • hidden_files
  • hide_app_files
  • hide_dot_files
  • hide_vcs_files
  • home_text
  • language
  • matomo_analytics_site_id
  • matomo_analytics_url
  • max_hash_size
  • meta_description
  • readmes_first
  • reverse_sort
  • site_title
  • sort_order
  • timezone
  • zip_downloads
  • zip_compress
  • Cache Configuration
  • cache_driver
  • cache_lifetime
  • cache_lottery
  • memcached_host
  • memcached_port
  • memcached_config
  • redis_host
  • redis_port
  • redis_config
  • http_cache
  • view_cache
  • Icon Configuration

Was this helpful?

Edit on GitHub
  1. Configuration

Configuration Reference

Bootstrap Configuration

These configuration options are special configuration options only configurable through environment variables (e.g. through the .env file).

There are no corresponding configuration options for these values in the app/config definitions because they are applied before the application container (and configuration) is loaded.

FILES_PATH

A path (relative or absolute) to the directory in which you would like to list. This may even be a path outside of the application directory. When left unset, the root application directory (i.e. the folder where index.php is located) will be listed.

An absolute or relative file path (string)

<unset>

COMPILE_CONTAINER

Whether or not the application container will be compiled. When set to false the container will not be compiled and cached. If left unset the container will be compiled and cached on first run and the cached container will be reused on subsequent requests. Disabling this comes with a (likely negligible) performance hit. Generally this should not be changed but might be necessary to modify when running Directory Lister on a read-only filesystem.

false or <unset>

<unset>

Runtime Configuration

General runtime configuration is controlled by the app config located at app/config/app.php. These options control core application functionality.

It is highly recommended to set these values via their respective environment variables. This can be accomplished via a .env file located in the root of your application. An example file is provided as .env.example.

analytics_file

File containing analytics scripts that will be included in the HTML output of your directory listing.

A (string) file name

.analytics

ANALYTICS_FILE

date_format

The format used for rendering dates in the application views.

Y-m-d H:i:s

DATE_FORMAT

debug

Enable application debugging and display error messages.

It is recommended that debug remains OFF unless troubleshooting an issue. Leaving this enabled WILL cause leakage of sensitive server information.

true or false

false

APP_DEBUG

display_readmes

Parse and render README files on the page.

true or false

true

DISPLAY_READMES

google_analytics_id

Your Google analytics tracking ID.

A string in the format of UA-123456789-0 or false to disable

false

GOOGLE_ANALYTICS_ID

hidden_files_list

File containing hidden file definitions. Will be merged with definitions from the 'hidden_files' configuration option.

A path (string) to a file

.hidden

HIDDEN_FILES_LIST

hidden_files

Array of hidden file definitions. Will be merged with definitions in the file defined in the hidden_files_list configuration option. Supports glob patterns (e.g. *.txt, file.{yml,yaml}, etc.).

An array of paths (strings)

[] (an empty array)

'hidden_files' => [
    'somefile.txt', // Matches 'somefile.txt' exactly
    'README.*', // Matches files named 'README' with any file extension
    'foo/*', // Matches all files in the 'foo' directory
    'schema.{ya?ml}', // Matches 'schema.yml' or 'schema.yaml'
]

hide_app_files

Hide application specific files/directories (i.e. index.php and the app folder).

true or false

true

HIDE_APP_FILES

hide_dot_files

Hide dot files/directories from the listing.

true or false

true

HIDE_DOT_FILES

hide_vcs_files

Hide the files Version Control Systems (i.e. Git and Mercurial) use to store their metadata.

true or false

true

HIDE_VCS_FILES

home_text

Text of the home link in the navigation breadcrumbs. If undefined or null will use the translated form of "home" from your selected language.

Any string

null

HOME_TEXT

language

The application's interface language.

en (English)

APP_LANGUAGE

matomo_analytics_site_id

Your Matomo analytics site ID.

A Matomo analytics site ID (string)

false

MATOMO_ANALYTICS_SITE_ID

matomo_analytics_url

Your Matomo analytics URL.

A Matomo analytics URL (string)

false

MATOMO_ANALYTICS_URL

max_hash_size

The maximum file size (in bytes) that can be hashed. This helps to prevent timeouts for excessively large files.

The larger a file is the longer it will take to calculate hashes for that file.

1000000000 (1 GB)

MAX_HASH_SIZE

meta_description

Meta tag description (i.e. <meta name="description">) text.

Any string

Yet another directory listing, powered by Directory Lister.

META_DESCRIPTION

readmes_first

Show READMEs before the file listing.

true or false

false

READMES_FIRST

reverse_sort

When enabled, reverses the order of files (after sorting is applied).

true or false

false

REVERSE_SORT

site_title

The title of your directory listing. This will be displayed in the browser tab/title bar along with the current path.

Any string

Directory Lister

SITE_TITLE

sort_order

When using an anonymous function it must be wrapped in a \DI\value() function. The anonymous function receives two \SplFileInfo objects as arguments and expects an integer to be returned.

Example

'sort_order' => \DI\value(
    function (SplFileInfo $file1, SplFileInfo $file2) {
        return strcmp($file1->getRealPath(), $file2->getRealPath());
    })
);

type, natural, name, accessed, changed, modified, <anonymous function>

type

SORT_ORDER

timezone

Time zone used for date formatting.

The server's timezone

TIMEZONE

zip_downloads

Enable downloading of directories as a zip archive.

true or false

true

ZIP_DOWNLOADS

zip_compress

Compress Zip using Deflate. Enabling this option prevents file size estimation and it may prevent zip download resuming when paused.

true or false

false

ZIP_COMPRESS

Cache Configuration

The cache config is located at app/config/cache.php. These options control the application cache.

It is highly recommended to set these values via their respective environment variables. This can be accomplished via a .env file located in the root of your application. An example file is provided as .env.example.

cache_driver

The application cache driver. Setting this value to array will disable the cache across requests. Additional driver-specific options may be required with certain values.

apcu, array, file, memcached, redis, php-file, valkey

file

CACHE_DRIVER

cache_lifetime

The app cache lifetime (in seconds). Setting this value to 0 will cache indefinitely.

Any positive integer

60 (one hour)

CACHE_LIFETIME

cache_lottery

Some cache drivers require manually pruning the cache periodically to remove expired items. This is the percentage chance (out of 100) of a request "winning" the lottery causing the cache to be pruned.

Any integer betweeen 1 and 100

2

CACHE_LOTTERY

memcached_host

The Memcached server hostname or IP address.

Any string

localhost

MEMCACHED_HOST

memcached_port

The Memcached server port.

Any valid port as an integer (0 to 65353)

11211

MEMCACHED_PORT

memcached_config

An anonymous function that receives a Memcached object

function (Memcached $memcached): void {
    // Configure the $memcached object
}
DI\value(function (Memcached $memcached, Config $config): void {
    $memcached->addServer(
        $config->get('memcached_host'),
        $config->get('memcached_port')
    );
})

This closure adds a single connection to a server at the host defined by memcached_host on the port defined by memcached_port.

Uses the MEMCACHED_HOST and MEMCACHED_PORT variables by default

redis_host

The Redis server hostname or IP address.

Any string

localhost

REDIS_HOST

redis_port

The Redis server port.

Any valid port as an integer (0 to 65353)

6379

REDIS_PORT

redis_config

An anonymous function that receives a Redis object

function (Redis $redis): void {
    // Configure the $redis object
}
DI\value(function (Redis $redis, Config $config): void {
    $redis->pconnect(
        $config->get('redis_host'),
        $config->get('redis_port')
    );
})

This closure adds a single connection to a server at the host defined by redis_host on the port defined by redis_port.

Uses the REDIS_HOST and REDIS_PORT variables by default

http_cache

HTTP cache values for controlling browser page cache durations. An array of mimetypes mapped to their cache duration in seconds..

[
    'application/json' => 300,
    'application/zip' => 300,
]

view_cache

Path to the view cache directory. Set to false to disable view caching entirely.

A directory path as a string or false to disable the view cache entirely

app/cache/views

VIEW_CACHE

Icon Configuration

icons.php
return [
    'icons' => [
        '7z' => 'fas fa-file-archive',
        'aac' => 'fas fa-music',
        'accdb' => 'fas fa-database',
        'ai' => 'fas fa-image',
        'aif' => 'fas fa-music',
        'apk' => 'fab fa-android',
        'app' => 'fas fa-window',
        'avi' => 'fas fa-video',
        'bak' => 'fas fa-save',
        'bat' => 'fas fa-terminal',
        // etc...
    ],
];
PreviousConfiguration OverviewNextHiding Files

Last updated 19 days ago

Was this helpful?

See the for possible values.

This configuration option has been deprecated and will stop working in a future release. See the section for instructions on configuring analytics tracking.

See the page for additional info on hiding files.

See the page for additional info on hiding files.

See the folder for available translations.

This configuration option has been deprecated and will stop working in a future release. See the section for instructions on configuring analytics tracking.

This configuration option has been deprecated and will stop working in a future release. See the section for instructions on configuring analytics tracking.

Any positive integer 0 - 9223372036854775807 ()

Sorting order of files and folders. Can be one of several predefined values or a custom .

For a list of supported time zones see: .

The Memcached configuration (closure). This option is used when the cache_driver configuration option is set to memcached. The closure receives a Memcached object as it's only parameter. You can use this object to configure the Memcached connection. At a minimum you must connect to one or more Memcached servers via the addServer() or addServers() methods.

Reference the for Memcached configuration options.

The Redis configuration (closure). This option is used when the cache_driver configuration option is set to redis. The closure receives a Redis object as it's only parameter. You can use this object to configure the Redis connection. At a minimum you must connect to one or more Redis servers via the connect() or pconnect() methods.

Reference the for Redis configuration options.

An array of mapped to their cache duration as a seconds (integers).

The icon config is located at app/config/icons.php. Here is were file types are mapped to their respective icons. The mapping is a PHP array where the array key is the file extension (without a preceding dot) and the array value is the desired class names.

PHP date format documentation
Hiding Files
Hiding Files
app/translations
PHP_INT_MAX
anonymous function
https://www.php.net/manual/en/timezones.php
anonymous function
PHP Memcached documentation
anonymous function
phpredis documentation
mime types
Font Awesome
Analytics Script Injection
Analytics Script Injection
Analytics Script Injection