cloakings / cloakings-cloakit
Cloakings CloakIT Client
1.1.0
2024-06-26 16:01 UTC
Requires
- php: >=8.3
- ext-curl: *
- cloakings/cloakings-common: ^1.1
- gupalo/json: ^1.0
- psr/log: ^3.0
Requires (Dev)
- phpunit/phpunit: ^10.5
README
Detect if user is bot or real user using cloakit.pro
Install
composer require cloakings/cloakings-cloakit
Usage
Basic Usage
Register at https://cloakit.pro. Create campaign:
- Link to the target page:
real.php
- Link for bots:
fake.php
Click "download code" for plain PHP or Wordpress and look for:
- clientId
- clientCompany
- clientSecret
$request = \Symfony\Component\HttpFoundation\Request::createFromGlobals(); $cloaker = \Cloakings\CloakingsCloakIt\CloakItCloaker( companyId: $companyId, ); $cloakerResult = $cloaker->handle($request);
Check if result mode is CloakModeEnum::Fake
or CloakModeEnum::Real
and do something with it.
If you want to render result like the original CloakIT library
$baseIncludeDir = __DIR__; // change to your dir with real.php and fake.php $renderer = \Cloakings\CloakingsCloakIt\CloakItRenderer(); $response = $renderer->render($cloakerResult);
Original Logic
Original library is located at doc/original
.
License for this repository doesn't cover that code.