Download the PHP package heddiyoussouf/mediasignature without Composer

On this page you can find all versions of the php package heddiyoussouf/mediasignature. 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 mediasignature

Mediasignature

Mediasignature is a powerful package that provides secure tokenization and time-limited access control for images. It allows you to protect your images by generating unique tokens and controlling access to them within specified time limits.

Features

Installation

To install Mediasignature, follow these steps:

  1. Clone the repository: composer require heddiyoussouf/mediasignature.
  2. Publish MediasigntureProvider: php artisan vendor:publish --provider=Heddiyoussouf\Mediasignature\MediasignatureProvider.
  3. Check the mediasignature file inside the config folder.

Getting Started

To start using Mediasignature, you need to perform the following steps:

  1. Import the Mediasignature facade into your project: Heddiyoussouf\Mediasignature\Facades\Mediasignature.
  2. Generate an url for an image Mediasignature::wrap()for single media file and Mediasignature::wrapForMultiple() for multiple file.

Documentation

Refer to the documentation for detailed usage instructions and code samples.

In a Laravel application, there are two common methods for uploading media files:

Moving File Directly to the Public Folder:

$request->image->move(public_path('/images'), 'name.jpg');

MedfiaFile::create(["path" => "images/name.jpg"]);

This approach involves moving the file directly to the public folder of your application using the $request->image->move() method. After moving the file, you can create a new record in the MediaFile model (assuming such a model exists) and store the file path.

Using the Filesystem:

$path = $request->file('image')->store('images');

// or

$path = Storage::disk('public')->putFile('images', $image);

MedfiaFile::create(["path" => $path]);

Laravel provides a filesystem API for file storage, which offers convenience and flexibility. You can use the $request->file()->store() method or the Storage::disk()->putFile() method to upload the file to the desired directory. After storing the file, you can create a new record in the MediaFile model and store the returned file path.

Please note that you should adjust the file paths and model names to match your specific application structure. Also, ensure that you handle any necessary validations or security measures when implementing file uploads in your Laravel application.

In Mediasignature, there are two common methods for wrapping media files. Here's a more formal description of each method:

Using Default Configuration:

$file = MediaFile::find($id);

return Mediasignature::wrap($file->path);

This approach utilizes the default configuration specified in the config/mediasignature.php file. The wrap() method is called with the file path as the parameter, and it returns a wrapped version of the file path (url).

Using Custom Configuration:

$file = MediaFile::find($id);

return Mediasignature::wrap($file->path, $ttl, $filesystem, $disk);

In this method, you can specify custom configuration options for wrapping the file: $ttl (integer/nullable): Sets the time-to-live in minutes, indicating the duration for which the wrapped file will be accessible. $filesystem (boolean/nullable): Set to false if you used the first method to upload media directly, and true if you used the filesystem. $disk (enum [local or public]/nullable): Specify the disk to be used if you used the filesystem option.

This method allows you to override the default configuration for a specific file. By providing custom values for $ttl, $filesystem, and $disk, you can control the wrapping behavior according to your requirements.

Additionally, you can use the Mediasignature::wrapForMultiple() method to wrap multiple files at once:

Mediasignature::wrapForMultiple($array_path)

Mediasignature::wrapForMultiple($array_path, $ttl, $filesystem, $disk)

These methods accept an array of file paths ($array_path) as the first parameter and provide options for customizing the wrapping process similar to the individual file wrapping method.

Please ensure that you provide appropriate values for the parameters and follow the documentation for proper usage of the Mediasignature package.

Contributing

We welcome contributions to Mediasignature! If you would like to contribute, please follow these steps:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature/your-feature
  3. Make your changes and commit them: git commit -am 'Add your feature'
  4. Push to the branch: git push origin feature/your-feature
  5. Submit a pull request.

Please ensure that your code follows the project's coding conventions and includes appropriate tests.


All versions of mediasignature with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 heddiyoussouf/mediasignature contains the following files

Loading the files please wait ...