Download the PHP package tyhand/document-downloader-bundle without Composer

On this page you can find all versions of the php package tyhand/document-downloader-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 document-downloader-bundle

Document Downloader Bundle

A quick, lazy, and somewhat useless bundle to provide a quicker way to produce links to a static pdf document while providing some minor security.

Installing

First add the project to your Symfony project's composer.json, which can be done via the command line like the following.

Next, add the bundle to your project's AppKernel.php in the register bundles method.

Next, since this bundle has a controller action, you need to include the bundle's routing file into the project's main routing file.

Finally, the bundle needs a path to the file containing the list of documents. By default the bundle will look for it at app/config/file_list.yml. If you desire the document list file to be there then installation of the bundle is complete; However, if you need the file list to be elsewhere you add a config option to change the location such as the following.

Usage

Basic

To create a link to a static document, first add the document to the file list yaml.

Then in the twig file where you want to have a link to the document use the twig function provided in the bundle to create something along the lines of the following.

Restricting By Roles

There are two ways to restrict by roles, 'allow' and 'deny'. Allow sets a list of roles that a user needs at least one of to retrieve the document; Whereas Deny sets a list of roles that if the user has any of them then they cannot retrieve the document.

For example, if given the following example config:

A user with the roles ['ROLE_USER', 'ROLE_SUPERVISOR'] can view both documents, but a user with the roles ['ROLE_USER'] can only view the my_pdf document. If the link to supervisor_notice was somehow visible to the user without the supervisor role, a 403 will be returned if they try to retrieve it.

Another example this time for deny:

In this case any user with 'ROLE_SUPERVISOR' cannot view the document.

Currently the 'allow' option and the 'deny' option cannot be used at the same time for a single file.


All versions of document-downloader-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/symfony Version >=2.2.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 tyhand/document-downloader-bundle contains the following files

Loading the files please wait ....