Download the PHP package s1syphos/php-gesetze without Composer

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

php-gesetze

License Packagist Build

Linking german legal norms, dependency-free & GDPR-friendly. php-gesetze automatically transforms legal references into a tags - batteries included.

There's also a Python port of this library, called py-gesetze.

For API documentation (powered by phpDocumentor), see here.

Installation

It's available for Composer:

Getting started

Upon invoking the main class, you may specify your preferred provider (or 'driver'), like this:

It's also possible to specify selected of two or more drivers as array:

Note: This defaults to all available drivers, which is a good overall choice, simply because of the vast array of supported laws. Possible values are gesetze, 'dejure', 'buzer' and 'lexparency'.

Out of the box, php-gesetze cycles through all known drivers until a match is found.

Usage

From there, the following functions are available:

analyze(string $string): array

Analyzes a single legal norm:

validate(string $string): bool

Validates a single legal norm (across all selected providers:

Note: In the context of this library, being valid means linkable by at least one provider, as in to be found in their database.

roman2arabic(string $string): string

Converts roman numerals to arabic numerals:

extract(string $string): array

Extracts legal norms as array of strings:

gesetzify(string $string, callable $callback): string

Transforms legal references into HTML link tags:

Note: For more flexibility, you may use your own callback method as second parameter of gesetzify. Callbacks are being passed arrays representing matched legal norms. This way, you could highlight them using <strong> tags instead of converting them into a tags. Default: (private) method linkify

Example

Note: Caching the result (to avoid repeated lookups & save resources) is beyond the scope of this library and therefore totally up to you!

Configuration

There are several settings you may use in order to change the behavior of the library:

$object->drivers (array)

Associative array, holding all available drivers (already initialized), where the corresponding keys are 'gesetze', 'dejure', 'buzer' & 'lexparency' (default).

$object->pattern (string)

The regex responsible for detecting legal norms. For reference, it amounts to this:

Note: Well, more or less - for the latest revision, please refer to src/Traits/Regex.php!

$object->attributes (array)

Other HTML attributes to be applied globally:

$object->title (false|string)

Controls title attribute:

Option Description
false No title attribute (default)
'light' abbreviated law (eg 'GG')
'normal' complete law (eg 'Grundgesetz')
'full' official heading (eg 'Artikel 12')

Credits

The regular expression used in this library is based on the jura_regex regex package by Philipp Kiersch (originally written in Python).

Special Thanks

I'd like to thank everybody that's making free & open source software - you people are awesome. Also I'm always thankful for feedback and bug reports :)


All versions of php-gesetze with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^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 s1syphos/php-gesetze contains the following files

Loading the files please wait ....