lhapaipai / mini-file-manager-template

Template model for Mini File Manager

Home Page:https://mini-file-manager.pentatrion.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mini File Manager Starter Template

This repository presents a complete example of the integration of the mini-file-manager package with the pentatrion/upload-bundle bundle in a Symfony backend.

Installation

git clone https://github.com/lhapaipai/mini-file-manager-template.git

git submodule update --init

chmod -R 777 var/{cache,log} public/{uploads,media}

composer install
# configure DATABASE_URL from .env (form example)
symfony console doctrine:database:create
symfony console doctrine:migrations:migrate -n

npm install
npm run build

Dependancies

Symfony logo Vue logo Vite logo

pentatrion/upload-bundle configuration for MiniFileManager

If you use this bundle with MiniFileManager and liipImagineBundle, you need to add additional filters.

# config/packages/pentatrion_upload.yaml
# default configuration
pentatrion_upload:
  file_infos_helper: 'Pentatrion\UploadBundle\Service\FileInfosHelper'
  origins:
    public_uploads:
      # if directory is inside %kernel.project_dir%/public, files
      # will be directly accessible.
      path: "%kernel.project_dir%/public/uploads"
      # prefix to add in order to be found by a liip_imagine loader
      liip_path: "/uploads"

    # # if you want private upload directory
    # private_uploads:
    #   path: "%kernel.project_dir%/var/uploads"
    #   liip_path: ""
  liip_filters: ["small", "large"]
# config/packages/liip_imagine.yaml
liip_imagine:
  driver: "gd"

  # define filters defined in pentatrion_upload.liip_filters
  # (at least small filter)
  filter_sets:
    small:
      filters:
        thumbnail: { size: [250, 250], mode: inset, allow_upscale: true }

    large:
      filters:
        thumbnail: { size: [1500, 1500], mode: inset, allow_upscale: false }

  loaders:
    default:
      filesystem:
        data_root:
          # must be linked with pentatrion_upload -> origin.[origin-name].liip_path
          - "%kernel.project_dir%/public"

          # if you want private upload directory
          # - "%kernel.project_dir%/var/uploads"

About

Template model for Mini File Manager

https://mini-file-manager.pentatrion.com


Languages

Language:PHP 68.6%Language:Twig 18.9%Language:JavaScript 5.1%Language:Shell 3.4%Language:SCSS 3.1%Language:Makefile 0.9%