Download the PHP package gbc/wn-mediafilerenamer-plugin without Composer

On this page you can find all versions of the php package gbc/wn-mediafilerenamer-plugin. 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 wn-mediafilerenamer-plugin

Media Files Renamer

This plugin addresses an issue that has long bothered me.

When your user uploads a file to the media manager, the filename remains as is, assuming that the user will be aware of best practices when naming files.

The plugin sanitizes the name of the file before saving it in the Media Manager.

Motivation

I develop sites for several types of users based on Winter. Most of my users are fairly well versed in the digital world, but, I have recently seen a large number of clients who are completely unaware of certain best practices when it comes to naming files.

This has been cause of several minor issues in some of my older projects, as clients upload files with spaces, upper and lower case files and the works. This inevitably leads to issues in some browsers and expected system behaviour.

As a way to mitigate this, I started implementing this functionality inside my projects, and as it became more commonly used, I decided to extract it as a plugin, and this is how this project was born.

What to expect

When a user uploads a file like: My picture with Sally.jpg this plugin will basically sanitze the name to my-picture-with-sally.jpg making the file more accessible to browsers, and as a added bonus, more SEO oriented.

The plugin also has a smart feature which is, if the sanitized file already exists, it will append a --N to it, where N is a number index.

For example: If the user uploads the following files, sequentially:

  1. My picture with Sally.jpg
  2. My Picture With Sally.jpg
  3. my picture with sally.jpg

which in a *nix based system would be three distinct files, the plugin will convert the first file to:

  1. my-picture-with-sally.jpg

When it tries to convert the second file, since the slugged name already exists, it will append a --1 to it:

  1. my-picture-with-sally--1.jpg

Finally, when trying to save the third file, it will also slug it to my-picture-with-sally.jpg, which already exists, append a --1 and try again, which also already exists, and finally settle on

  1. my-picture-with-sally--2.jpg

CAVEATS AND WARNINGS

This plugin works only in the media manager

This plugin is designed to work with the media manager only. If you are uploading files directly to the system, this plugin will not fix your problem.

This plugin works only with the UPLOAD media event

This plugin treats only uploads. Already existing files will not be renamed and renaming a file will not trigger this plugin check. (I might in the future, implement such a feature, but for now, this is well within my needs).

This plugin works only on files

If a user creates a folder that is not web friendly, this plugin will not correct the folder name. It will only correct the media file.

Again, I might in the future implement such a feature, but I have not needed such a thing.


All versions of wn-mediafilerenamer-plugin with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ~1.0
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 gbc/wn-mediafilerenamer-plugin contains the following files

Loading the files please wait ....