Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves embedded mode when not using rewrite rules #32

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.project
.settings
.idea
/nbproject/
55 changes: 51 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# PHP File Manager

A good solution for managing files and folders for developers who can't access their site over SSH or FTP.
A good solution for managing files and folders for developers who can't access
their site over SSH or FTP or who need "www-data" permission (*nix).

![PHP File Manager](https://raw.github.com/alexantr/filemanager/master/phpfm.png)

Expand Down Expand Up @@ -35,12 +36,17 @@ To enable or disable authentication set `$use_auth` to `true` or `false`.
You can include file manager in another script. Just define `FM_EMBED` and other necessary constants. Example:

```php
class SomeController
class FileManagerController
{
public function actionIndex()
public function runAction()
{
define('FM_EMBED', true);
define('FM_SELF_URL', UrlHelper::currentUrl()); // must be set if URL to manager not equal PHP_SELF
// must be set if URL to manager is not equal to PHP_SELF
define('FM_SELF_URL', 'https://host/path/index.php?controller=FileManager&action=run';

// if document root location is different to filesystem
define('FM_ROOT_PATH', '/tmp'); // playground first!

require 'path/to/filemanager.php';
}
}
Expand All @@ -51,10 +57,51 @@ Supported constants:
- `FM_ROOT_PATH` - default is `$_SERVER['DOCUMENT_ROOT']`
- `FM_ROOT_URL` - default is `'http(s)://site.domain/'`
- `FM_SELF_URL` - default is `'http(s)://site.domain/' . $_SERVER['PHP_SELF']`
- `_FM_SELF_URL` - internal usage (to improve embedded usage)
- `FM_ICONV_INPUT_ENC` - default is `'CP1251'`
- `FM_USE_HIGHLIGHTJS` - default is `true`
- `FM_HIGHLIGHTJS_STYLE` - default is `'vs'`
- `FM_DATETIME_FORMAT` - default is `'d.m.y H:i'`
- `FM_SESSION_ID` - Session name and session key (default 'filemanager') to prevent conflicts


Public parameters/ actions in use (when using embedded you may need this info):

- `p` - filesystem path to use
- `new` - Create a new directory
- `copy` - Copy a file or directory src
- `move` - Flag to move and not to copy a file or directory
- `finish` - Flag to enable file/directory copy/movements

- `ren` - Rename selected file or directory
- `to` - Rename target

- `dl` - Download selected file

- `del` - delete a file/ directory

- `group` - Mass deletion of selected items
- `delete`

- `group` - Pack selected items
- `zip`

- `unzip` - Unpack selected item
- `tofolder` - Upack to folder of zip's filename

- `chmod` - Change mode (permissions) of selected item

- `view` - Show selected item (list zip contents, shows images/media or mime:text files)

- `logout` - logout (if enabled)
- `img` - Show a selected image

- `upl` - Flag for uploads
- `upload` - Upload _FILES

- `fm_usr` - Login user (if auth enabled)
- `fm_pwd` - Login pass (if auth enabled)


## Alternatives

Expand Down
Loading