andrew-svirin/resource-crawler-bundle
symfony/http-client (replaceable with Laravel’s Http facade or Guzzle).symfony/lock (replaceable with Laravel’s Cache or Database locks).ext-dom/ext-libxml (already required for Laravel’s HTML parsing).Schema::create().rollbackTask() method assumes Symfony’s process management. Laravel’s queue system (e.g., shouldRequeue()) would need adaptation.spatie/laravel-symfony-bridge.symfony/http-client compatibility.Lock system vs. Laravel’s queues (failed_jobs table, retry-after).errored nodes be logged? Laravel’s Log facade vs. Symfony’s Monolog.| Symfony Component | Laravel Equivalent | Integration Strategy |
|---|---|---|
symfony/http-client |
Http facade / Guzzle |
Replace with Laravel’s Http or wrap Guzzle in a service. |
symfony/lock |
Cache::lock() / Database locks |
Use Laravel’s Cache or Database locks with a custom service. |
| Doctrine DBAL | Eloquent / Laravel Migrations | Convert raw SQL to Eloquent models or Schema::create(). |
| Symfony DI Container | Laravel Service Container | Use spatie/laravel-symfony-bridge or manually bind services via AppServiceProvider. |
| Symfony YAML Config | Laravel Config (config/crawler.php) |
Migrate resource_crawler.yaml to Laravel’s config system. |
Phase 1: Dependency Isolation
symfony/http-client with Laravel’s Http facade.symfony/lock with Cache::lock() or a custom lock service.spatie/laravel-symfony-bridge for partial Symfony compatibility.Phase 2: Database Schema
// app/Models/ResourceCrawlerProcess.php
class ResourceCrawlerProcess extends Model {
public function nodes() { return $this->hasMany(ResourceCrawlerNode::class); }
}
Schema::create('resource_crawler_processes', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->timestamps();
});
Phase 3: Service Binding
AppServiceProvider:
$this->app->bind('resource_crawler.crawler', function ($app) {
return new \AndrewSvirin\ResourceCrawlerBundle\Crawler\ResourceCrawler(
// Inject Laravel-compatible dependencies
);
});
Phase 4: Task Management
rollbackTask() with Laravel’s queue logic:
if ($someExceptionCondition) {
$task->release(60); // Requeue after 60 seconds (Laravel Queue)
}
Storage facade may need adaptation for path handling.symfony/lock).Monolog or Laravel’s Log) before production use.symfony/http-client) if not replaced.telescope for debugging crawler tasks.errored nodes.Lock system may not scale as well as Laravel’s distributed cache locks.Cache::lock() with redis driver).status and process_id are provided; ensure Laravel’s query builder optimizes them.queue:work with --memory=4G.$task->onQueue('crawlers'); // Dedicated queue for crawler tasks
| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Database connection issues | Crawled nodes lost | Use transactions and Laravel’s database events for recovery. |
| PHP memory exhaustion | Crawler crashes | Set queue:work --memory=2G and implement chunked processing. |
| Rate limiting (web crawling) | IP banned | Use Laravel’s Http with retries and delays (->retryAfter(5)). |
| Lock contention | Duplicate processing | Use Redis for distributed locks (Cache::lock()). |
| Queue worker crashes | Stuck tasks | Implement Laravel’s failed_jobs table monitoring and dead-letter queues. |
Lock system vs. Laravel’s caching.spatie/laravel-symfony-bridge, additional setupHow can I help you explore Laravel packages today?