s1syphos/php-dejure

Linking texts with dejure.org, the Class(y) way.

1.5.1 2021-10-25 20:04 UTC

This package is auto-updated.

Last update: 2024-11-26 11:03:41 UTC


README

Release License Issues Status

A PHP library for linking legal norms in texts with dejure.org.

History

This library started as an OOP port of vernetzungsfunction.inc.php, which can be downloaded here. Since then, php-dejure heavily modified the underlying caching mechanism, now providing a broad range of fully configurable cache drivers while featuring more text processing options.

Getting started

Install this package with Composer:

composer require S1SYPHOS/php-dejure

An example implementation could look something like this:

<?php

require_once('vendor/autoload.php');

use S1SYPHOS\DejureOnline;

$object = new DejureOnline();

$object->setEmail('hello@mydomain.com');
$object->setTarget('_blank');

$text  = '<div>';
$text .= 'This is a <strong>simple</strong> HTML text.';
$text .= 'It contains legal norms, like Art. 12 GG.';
$text .= '.. or ยง 433 BGB!';
$text .= '</div>';

echo $object->dejurify($text);

Roadmap

  • Add tests
  • Add checks to __construct
  • Attempt cache directory creation
  • Improve code
  • Improve code more
  • Translate code (almost done)
  • join paths, so trailing slash is no longer required
  • Add cache reset function

Happy coding!