Skip to content

lord3nd3r/php-indexer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

PHP Directory Indexer

A self-contained, single-file PHP directory browser with built-in theme support.

PHP License

Features

  • Single file — just drop index.php into any directory
  • Directory browsing — navigate into sub-folders with breadcrumb navigation
  • Sortable columns — sort by name, date modified, or file size (ascending/descending)
  • 6 built-in themes — Dark, Light, Dracula, Nord, Solarized, Gruvbox
  • Theme persistence — selection saved via cookie
  • Responsive design — works on mobile, tablet, and desktop
  • File-type icons — emoji-based icons for folders, images, audio, video, code, archives, documents, and more
  • File extension badges — inline badges showing file type at a glance
  • Secure path handlingrealpath() validation prevents directory traversal attacks
  • No dependencies — no database, no composer packages, no JavaScript frameworks

Installation

  1. Copy index.php into any directory served by Apache/Nginx with PHP:
cp index.php /var/www/html/my-files/
  1. Visit the directory in your browser. That's it.

Configuration

All options are at the top of index.php:

Option Default Description
$browseDirectories true Allow navigating into sub-folders
$title 'Index of {{path}}' Page title ({{path}}, {{files}}, {{size}} are template vars)
$subtitle '{{files}} objects...' Subtitle below the title (empty string to disable)
$breadcrumbs true Clickable path segments in the title
$showDirectories true Show folders in the listing
$showDirectoriesFirst true Folders appear before files when sorting by name
$showHiddenFiles false Show dotfiles (.htaccess, etc.)
$showIcons true Show file-type emoji icons
$dateFormat 'd/m/y H:i' PHP date() format string
$defaultTheme 'dark' Initial theme: dark, light, dracula, nord, solarized, gruvbox
$ignore ['index.php'] Files/folders to hide from the listing
$alignment 'center' Page alignment: 'center' or 'left'

Themes

Switch themes from the dropdown in the top-right corner. The selection is saved in a cookie.

Theme Description
Dark Default dark gray theme
Light Clean white/gray
Dracula Purple, cyan, and pink
Nord Cool blue-gray arctic palette
Solarized Classic solarized dark
Gruvbox Warm retro brown and amber

Adding Custom Themes

Add a new entry to the $themes array in index.php:

'mytheme' => [
    'label'         => 'My Theme',
    'bg'            => '#000000',
    'card-bg'       => '#111111',
    'text'          => '#eeeeee',
    'text-muted'    => '#888888',
    'heading'       => '#ffffff',
    'link'          => '#ff6600',
    'link-hover'    => '#ff9900',
    'row-hover'     => '#222222',
    'border'        => '#333333',
    'header-border' => '#444444',
    'footer'        => '#555555',
    'badge-bg'      => '#222222',
    'badge-text'    => '#ff6600',
    'select-bg'     => '#222222',
    'select-text'   => '#eeeeee',
],

Requirements

  • PHP 8.0+
  • A web server (Apache, Nginx, etc.)

License

MIT

About

php based indexing script with built in themes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages