Simple PHP/cURL/FlareSolverr framework with Logger, Cache and more!
$ composer require orkan/tlc
// Setup
use Orkan\TLC\Application;
use Orkan\TLC\Factory;
use Symfony\Component\DomCrawler\Crawler;
require __DIR__ . '/vendor/autoload.php';
$Factory = new Factory( require __DIR__ . "/cfg.php" );
$Application = new Application( $Factory );
$Application->run();
// GET page
$html = $Factory->Transport()->get( $url = 'http://example.com/welcome.php' );
$Crawler = new Crawler( $html );
// Fill & POST "Log in" FORM
$fields = $Crawler->filter( '#form-login' )->form()->getValues();
$fields['user'] = 'Me';
$fields['pass'] = 'secret';
$Factory->Transport()->post( $url, [ 'fields' => $fields ] );
// Log some info...
$Factory->Logger()->info( 'Form fields: ' . print_r( fields, true ) );
For more examples see /demo
folder.
PHP ^7.4
MIT
Wed, 26 Mar 2025 17:04:39 +01:00