s1syphos / php-dejure
Linking texts with dejure.org, the Class(y) way.
1.5.1
2021-10-25 20:04 UTC
Requires
- guzzlehttp/guzzle: ^7.3
- shieldon/simple-cache: ^1.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.14
- phpunit/phpunit: ^9.5
README
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!