Download the PHP package 2media/policies-builder without Composer

On this page you can find all versions of the php package 2media/policies-builder. 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 policies-builder

2media Policies Builder

Tests Check & fix styling

A PHP package to build and generate policies for landingpages and websites. It currently supports the following policies:

Installation

The package can be installed via composer.

Usage

Jigsaw

Before you can start generating policies with the package, you need to first configure your Jigsaw project.

Collection & Template

Add a new remote collection to your project. Add the following line to your projects config.php. (If you already use collections in your project, only add the policies key to your existing collections-array.)

This remote collection will be responsible for generating all configured policies.

In addition create a new layout file under source/_layouts.policy. All generated policies will extend this layout file.

Policies Configuration

Next, add a policies key to your projects config.php with a PoliciesConfiguration instance.

The PoliciesConfiguration-object holds configuration values which are used by all policies. See below for supported methods.

languages([])

Required. Accepts an array of ISO-639-1 language codes for which policies should be generated.

We currently support:

domain(string)

Required. The domain of the project.

brand(string)

Optional. Defaults to 2media. Define for which brand the policies should be generated. Depending on the brand, different policies are generated.

variant(string)

Optional. Defaults to default. Define which variant of policies you would like use in this project.

TODO: Needs better documentation and examples.

types([])

Required. An array of configured policies. See Supported Policies for details.

Supported Policies

The following policies can currently be built with this package.

Terms of Service

By adding the following policy to the type() method of the PoliciesConfiguration a terms of service policy is being generated.

If the website is operated in cooperation with a different company, use the inCooperationWith() method to indicate this in the terms of service. (Note that not all variants support this feature.)

If the website is operated on behalf of a different company, use the onBehalfOf() method to indicate this in the terms of service. (Note that not all variants support this feature).

Imprint

To generate imprints, add the following code to the type() method of the PoliciesConfiguration. Optionally, the package also generates an image copyright section for you.

imageCopyrights([Stringable])

Optional. Use the imageCopyrights() method and the Copyright-object to define the image copyrights of the project. If the project contains Icons which you do not want to list each on it's own use the IconCopyright-object.

Please always use the domain of the source instead of its name.

(Note the example below assumes you use PHP 8.0 and Named Arguments)

If none of the above classes solve the Copyright question for your project, feel free to create your own Copyright class. It just needs to implement the Twomedia\PoliciesBuilder\Contracts\Stringable interface – meaning just add a __toString method to your class.

Privacy Policy

By adding the following policy to the type() method of the PoliciesConfiguration a privacy policy is being generated.

There are currently no specific configuration options available for PrivacyPolicy.

Conditions of Participation

To generate a "Conditions of Participation" policy for competition campaigns, add the following block to the type() method of the PoliciesConfiguration.

closingDate(string)

Use the closingDate() method to pass the end date of the competition to the policy.

Global Translations

Instead of defining the translations for the names of the policies ("Impressum", "Conditions d’utilisation") for the policies in your Jigsaw project, you can use the GlobalTranslator that comes with the package.

The GlobalTranslator connects with our Webservice and gets the translations from a central place. If you follow these directions, the HTTP requests won't have any impact on the build time, as the requests/responses are cached for 24 hours on your machine.

Setup Caching As Jigsaw doesn't expose a Cache system like in a normal Laravel application, we have to do it ourselves. Add the following line to your bootstrap.php file to register the packages cache into the Jigsaw Container.

Add transGlobal function Add the following line to your projects config.php to expose the GlobalTranslator in your projects blade templates.

In your templates, you can now use transGlobal() method to get translated strings for all the policies.

Available Translations Keys

The following translations keys are currently available:

The key are defined by the Webservice app. You can find the German version of the available keys here.

Statamic

The package currently doesn't support Statamic yet.

Install local version in a project

If you're working on the package locally and want to test thing in a demo project you can use the composer path-repository format. Add the following snippet to the composer.json in your demo project.

And "install" the package with composer require 2media/policies-builder or composer update 2media/policies-builder. The package should now be symlinked in your demo project.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of policies-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-json Version *
guzzlehttp/guzzle Version ^7.2
illuminate/cache Version ^11.0 || ^12.0
illuminate/container Version ^11.0 || ^12.0
illuminate/filesystem Version ^11.0 || ^12.0
illuminate/http Version ^11.0 || ^12.0
illuminate/translation Version ^11.0 || ^12.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 2media/policies-builder contains the following files

Loading the files please wait ...