Download the PHP package jyxon/gdpr-cookie-compliance without Composer

On this page you can find all versions of the php package jyxon/gdpr-cookie-compliance. 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 gdpr-cookie-compliance

Donate License: MIT

GDPR cookie compliance package

The new GDPR Law brings some changes with it to the behavior of cookies. This package provides a simple implementation that can be used to comply with these new set of rules. This law is targeting cookies that can be used to identify a visitor. This identification through cookies is now considered personal information, so it requires extra care and consent. Visitors of your website need to have the following two abilities surrounding cookies:

Contents

To comply with this law this package adds the following abilities in an easy implementation.

Installation

Add the package to your project through composer with the following command:

Implementation

Configuration

There are 2 main components to the configurations.

scopes

The scopes are the different areas cookies can be set for. For example you could have functional and analytical cookies. A scope entry looks like the following:

The first parameter scope, is a name you will use throughout your code to identify the type of cookie. This should be a string. The second parameter required, is a flag to determine if the cookie is necessary for normal operations. This should be an integer (either 1 or 0). The third parameter title, is the title of the cookie that is shown to the user in the settings. This should be a string. The fourth parameter description, is the description for the cookie, which is also shown to the user.

As much scopes as necessary can be added and used through this file.

messages

The messages are a predefined set of key/value paired strings to show certain messages or titles in the pop-up/settings button. The keys should stay intact, but the values can be adjusted to your liking.

required_help = the balloon that shows when you hover over a required checkbox. settings_button = the title of the button in the lower right corner (with default styles). cookiebar_title = the title of the cookie bar itself. cookiebar_button = the title of the save settings button. cookiebar_description = the description that is shown on the cookie bar under the title.

Frontend (JS)

This package provides three small packages for JavaScript, and some additional styling.

cookie_tool.js

The cookie_tool has three basic cookie functions. To initialize the tool load the cookie_tool.js file to your HTML (depending on your project, you might have to move the file to your pub folder). To create an instance simply write the following code. Below is also defined which functions are exposed in this tool.

gdpr_compliance.js

This file contains the logic for the cookie bar. It should add a cookie bar and a settings button to your DOM (before the end on the body). For this tool to work, you also need to have contents of the config.json (or your own) file exposed to the function.

To initialize this write down the following code:

gdpr_cookie.js

For some projects it might be required to set and get cookies through JavaScript. That is where this tool comes into play. To initialize this tool use the following code:

The gdpr_cookie tool exposes the setCookie and getCookie functions in almost the same way as the cookie_tool, except these are now wrapped in checks for consent. It also implements the deleteCookie function so you don't have to switch between tools all the time.

gdpr_cookie_bar.css

This tool is also shipped with a complimentary stylesheet, just include it in your HTML and it should at least look decent.

Backend (PHP)

To also use the package for the backend (PHP only), use the following libraries.

Settings

Before setting cookies, the application should know is allowed and what not. To load the Settings write the following code.

The settings file can also be changed by giving the __construct a path (string) as a parameter. Like so:

Manager

In order to set cookies, the Manager needs to be used. The Manager has a dependency on Settings. To initialize the Manager write the following code:

The Manager can then be used to replace your standard setcookie functions with an additional parameter: scope. As an example the following could be done:

The only variable that gets added is the first one, this is the scope in which the cookie "lives". The manager exposes the following functions:

Feedback

We like to get some feedback on this package. You can do so by creating an issue on GitHub.

Donate

If this package helped you out, please consider donating.

MIT License

Copyright 2018 Jyxon

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


All versions of gdpr-cookie-compliance with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0|^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 jyxon/gdpr-cookie-compliance contains the following files

Loading the files please wait ....