Download the PHP package fpokoj/richfilemanager-php without Composer

On this page you can find all versions of the php package fpokoj/richfilemanager-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package richfilemanager-php

PHP connector for Rich Filemanager

This package is the part of RichFilemanager project.

Requires PHP >= 5.6.4

Introduction

PHP connector provides a flexible way to manage you files at different king of storages. There are 2 storages supported out of the box:

Configuration details for each are described below. You create implementation for any other storage that you wish by implementing Api and Storage classes.

Installation

NOTE: Most likely you won't have to install PHP connector separately. It's sufficient to run composer of the main package. Check out the installation guide of RichFilemanager main package for PHP connector.

AWS PHP SDK

If you are going to use AWS S3 storage make sure that AWS PHP SDK package version >= 3.18.0 is added to the "require" section of RichFilemanager composer.json file:

FYI - Amazon PHP SDK installation guide: https://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/installation.html

Entry point setup

RichFilemanager provides entry point script out of the box, so you don't have to create it from scratch. In this section you can find explanations and examples to setup the entry script.

  1. Initiate application.

  2. Create and set storage class instance. Usually you will use a single storage, but it's possible initiate instances for various storages to use both in API. For example, AWS S3 API can use S3 storage instance to manage original files and Local storage to manage image thumbnails. More details in the Configuration section.

  3. Create and set API class instance. You can set only one API instance unlike storage instances.

OR

  1. Run application.

Configuration

Configuration files are included in the package, but you can easily redefine any options upon creating storage instance. To do this you have to pass array of options to the storage class constructor. See examples below.

Local filesystem storage

Check out configuration file options. Each option in the file is well commented and won't be duplicated in this article.

Example to override the default options in the configuration file:

AWS S3 storage

Check out configuration file options.

Most of the configurations options for AWS S3 storage are the same as for Local filesystem storage, and come from config.local.php file.

Note that according to default configuration image thumbnails will be stored at the AWS S3 storage along with other files. This example demonstrates how to change this behavior and store thumbnails to the "s3_thumbs" directory at the local storage:

Security

Since the RichFilemanager is able to manipulate files on your server, it is necessary to secure safely your application.

The security section of the configuration file defines options which give you a wide range of customizations in the security aspect. Learn the comments carefully to understand the use of each.

Server scripts execution

By default, all server scripts execution are disabled in the default userfiles folder. See .htaccess and IIS files content.

User storage folder access

By default, everyone is able to access user storage folder. To make your application secure the entry script provides a few predefined functions which allow you to define your own authentication mechanism.

  1. fm_authenticate() - Authenticate the user, for example to check a password login, or restrict client IP address. If function returns false, the user will see an error. You can change it to redirect the user to a login page instead.

This function is called for every server connection. It must return true.

NOTE: This function only authorizes the user to connect and/or load the initial page. Authorization for individual files or dirs is provided by the functions below.

  1. fm_has_read_permission() - Perform custom individual-file READ permission checks.

This function is called before any filesystem read operation, where $filepath is the absolute path to file or directory being read. It must return true, otherwise the read operation will be denied.

NOTE: This is not the only permissions check that must pass. The read operation must also pass:

  1. fm_has_write_permission() - Perform custom individual-file WRITE permission checks.

This function is called before any filesystem write operation, where $filepath is the absolute path to file or directory being written to. It must return true, otherwise the write operation will be denied.

NOTE: This is not the only permissions check that must pass. The write operation must also pass:

Specify user storage folder

Local storage folder

There are 2 configuration options which affects the location of a storage folder of user files:

serverRoot (bool)
fileRoot (bool|string)

By combining values of these options you can change target location of storage folder.

serverRoot - "true" by default, means that storage folder location is defined relative to the server document root folder. Set value to "false" in case the storage folder of user files is located outside server root folder. If fileRoot options is set to "false", serverRoot value is ignored - always "true".

fileRoot - "false" by default, means that storage folder is located under server document root folder and named "userfiles". You can set specific path to the storage folder of user files instead of "false" value with the following rules:

You could change the options values as it's described in the Configuration section in two ways:

1. Upon configuring storage instance
2. Using "setRoot" storage method

Parameters of the setRoot method are as follows:

  1. Relative or absolute path to folder (see examples below)
  2. whether to create folder if it does not exist
  3. same as "serverRoot" configuration option
Local storage folder setup examples
  1. Default case - user folder located inside the RichFilemanager root folder

The default user folder is named "userfiles" and located inside the RichFilemanager root folder. After the application is deployed it should automatically detect the "userfiles" folder location, so you don't need to make any changes in configuration options, which looks as follows by default:

  1. Specify user folder located UNDER server document root folder
  1. Specify user folder located OUTSIDE server document root folder

IMPORTANT: If a storage folder of user files is located outside server document root folder, then the application is unable to define absolute URL to user files. RichFilemanager still able to preview the files, but by reading them via connector URL instead of using absolute URL.

That means the preview URL will look similar to:

http://mydomain.com/my_project/filemanager/connectors/php/filemanager.php?mode=readfile&path=/image.jpg

Instead of absolute direct URL:

http://mydomain.com/my_project/filemanager/files/image.jpg

This may cause problems in case integration RichFilemanager with WYSIWYG editors.

Luckily in most cases it's possible to specify URL to access storage folder explicitly. See Handle preview URL RichFilemanager wiki article for the details.

Setting dynamic user folder based on session

This example shows how to set storage folder path dynamically based on session variable.

AWS S3 storage folder

Since AWS S3 storage root folder depends on your S3 bucket configuration you are only able to change user folder under the bucket. Use "setRoot" storage method:

Parameters of the setRoot method are as follows:

  1. Relative path to S3 storage "folder" under the bucket.
  2. Whether to create folder if it does not exist

Debug and Logging

If you have any problem using RichFilemanager you may want to see what's happening.

All logs are stored at your local filesystem, so you have to configure your Local filesystem storage

To enable logger set logger.enabled option to true, also you can specify full path to logfile with logger.file option:

Notice that, by default, logs are disabled and logfile location is defined by sys_get_temp_dir() PHP function:

MIT LICENSE

Released under the MIT license.


All versions of richfilemanager-php with dependencies

PHP Build Version
Package Version
Requires php Version >= 5.6.4
symfony/http-foundation Version ~3.0
symfony/event-dispatcher Version ~3.0
illuminate/config Version 5.4.*
illuminate/container Version 5.4.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fpokoj/richfilemanager-php contains the following files

Loading the files please wait ....