Download the PHP package reun/nanomanager without Composer
On this page you can find all versions of the php package reun/nanomanager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download reun/nanomanager
More information about reun/nanomanager
Files in reun/nanomanager
Package nanomanager
Short Description Modern and minimalist file manager in a single PHP file
License MIT
Informations about the package nanomanager
Nano File Manager
Nano File Manager (or Nanomanager for short) is a minimalist PHP file manager that can be used to quickly add simple uploads and file management to any PHP powered website.
❗ Caution
Nanomanager doesn't include any authentication! Therefore it is very important to manually secure access to it.
Features
- List, upload, rename and delete files in a specific folder
- Quickly copy links to files
- Lightweight and performant
Installation
Requirements
With Composer
PHAR (single file install)
If you're not using Composer or simply want Nanomanager in a single self-contained file, you can download the latest PHAR from releases and put it anywhere outside your public folder. Then just require it whenever you want to use it.
Usage
To use Nanomanager, create a new instance by passing configuration to
constructor and call run() which returns a string that can be outputted to
browser.
Framework integration
You can manually pass request method and body to run() as optional arguments
to integrate Nanomanager with any existing PHP framework.
💡 Tip
Check out
tests/integrationdirectory for additional usage examples.
Configuration
PHP API configuration
PHP API is configured with constructor parameters. Check out
Nanomanager.php for full list
of options.
Frontend configuration
Frontend is configured with HTML attributes. Check out Props interface in
NanoFileManager.svelte for full
list of options.
If you're not embedding
frontend yourself, you can
customize frontend with frontendAttributes parameter.
Embedding Nanomanager frontend to existing page
Nanomanager frontend can easily be embedded to any existing HTML page or JS framework as a custom element.
The custom element is loaded from nanomanager.js file, which can be found
in vendor/reun/nanomanager/packages/frontend/dist/nanomanager.js if you
installed Nanomanager with Composer. For PHAR installation, you can copy the
file from releases.
Using <script> tag in HTML file
To embed Nanomanager into any HTML page, you need to copy nanomanager.js
into publicly accessible asset directory and include it as a script tag. It is
recommended to rename the file to include version number to avoid caching
issues.
💡 Tip
Check out
tests/integration/framework-testfor a complete example.
Using import in JS
You can import Nanomanager in JS to load the custom element. We're using Vue
as an example, but it works with any JS framework or even without one.
Frontend customization and theming with CSS
<nano-file-manager> exposes its root element as
part
attribute with the name body. You can target this element with
nano-file-manager::part(body) CSS selector to set theme variables or use
custom CSS. See
NanoFileManager.svelte for a
full list of available theme variables and
index.html in framework
integration test as an example.
Additional tips
Setting URL dynamically
You can utilize $_SERVER to set URL dynamically when configuring Nanomanager.
This is useful for development and testing.
ℹ️ Important
It is recommended to set URL manually in production instead of relying on
$_SERVERglobal. This is also illustrated in the example below.
Development
See docs/development for development
documentation.