Download the PHP package 2lenet/entity-file-bundle without Composer

On this page you can find all versions of the php package 2lenet/entity-file-bundle. 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 entity-file-bundle

EntityFileBundle

With this bundle, you can attach files to entities.

Installation

Configuration

This bundle works with configurations. A configuration = 1 entity 1 file system.

For example, you may have a configuration for the logo of multiple sellers, and a configuration for the pictures of the products they sell.

Basic configuration

In lle_entity_file.yaml

That's it! With the default storage adapter configuration, those files will be saved under data/seller_logos

Change the storage adapter

This bundle uses the FlySystem Symfony Bundle. You can create your own storage adapters, (Local disk, FTP, Drive...).

For that, you need to configure a new adapter. Then, change the storage_adapter of your configuration.

Usage

First of all, you need to get the manager for your configuration. For that, use the Lle\EntityFileBundle\Service\EntityFileLoader

Create a file

$data may be a string, a Symfony File object (including UploadedFile) or a resource.

:warning: Never forget to persist and flush the EntityFile.

You can use your own Entity class, it needs to be a Doctrine entity that implements Lle\EntityFileBundle\Entity\EntityFileInterface. For your convenience, the trait LleEntityFileBundle\Entity\Trait\EntityFileTrait exists.

You will also have to update your configuration:

Create your own storage adapter in flysystem.yaml, which is basically a copy of the default one with different directory option.

Retrieve files

Retrieve files from URL

If you didn't use Symfony Flex, you need to add the routes in routes.yaml:

Two routes are available:

Protect your urls

By default, only logged in users can access those urls. You can change the role key in the configuration:

You can use "PUBLIC_ACCESS" in the role key.

Create a custom voter.

Change content disposition (Show in browser or automatically download)

By default, files are served inline. You can change the disposition key under your configuration:

Access file contents

Delete a file

Rename or move a file

:warning: Never forget to flush the EntityFile.

Exception handling

https://flysystem.thephpleague.com/docs/usage/exception-handling/

Crudit

This bundle is compatible with 2LE's Crudit bundle.

You can use the EntityFileBrick, for example in tabs:

It features a dropzone where you can see, add, remove and download files.


All versions of entity-file-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
league/flysystem-bundle Version ^3.0
doctrine/orm Version ^2.12
doctrine/doctrine-bundle Version ^2.6
symfony/webpack-encore-bundle Version ^2.0
gedmo/doctrine-extensions Version ^3.7
symfony/form Version ^6.1 || ^7.1
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 2lenet/entity-file-bundle contains the following files

Loading the files please wait ....