
Composer & Autoloading
Composer basics, composer.json, autoloading PSR-4, dependency management, semantic versioning, scripts, security audit
1What is Composer in the PHP ecosystem?
What is Composer in the PHP ecosystem?
Respuesta
Composer is the standard dependency manager for PHP, allowing developers to declare and install libraries that a project depends on. It automatically manages compatible versions and downloads packages from Packagist. Unlike PEAR (legacy manager), Composer installs dependencies per project rather than globally.
2Which file contains the list of dependencies for a PHP project managed by Composer?
Which file contains the list of dependencies for a PHP project managed by Composer?
Respuesta
The composer.json file is the project manifest that declares all dependencies, custom scripts, autoloading configuration, and project metadata. This file is versioned in Git and edited manually. The composer.lock is automatically generated and should never be manually edited.
3Which Composer command installs project dependencies without updating composer.lock?
Which Composer command installs project dependencies without updating composer.lock?
Respuesta
The composer install command reads the composer.lock file (or composer.json if .lock is missing) and installs exactly the specified versions, ensuring identical installations across all environments. In production or when cloning a project, always use install to reproduce the exact environment. The update command upgrades versions and modifies composer.lock.
What is the difference between require and require-dev in composer.json?
What is the role of the composer.lock file?
+15 preguntas de entrevista
Otros temas de entrevista Laravel
PHP Basics
PHP OOP Essentials
Laravel Fundamentals
Laravel Routing
Blade Templates
Request & Response
Eloquent ORM Basics
Eloquent Relationships
Migrations & Schema Builder
Validation & Forms
Authentication
Authorization & Policies
API Resources & Authentication
Middleware
Service Container & DI
Queues & Jobs
Events & Listeners
Notifications & Mail
File Storage
Testing & PHPUnit
Caching
Livewire & Inertia
Eloquent Advanced
Repository Pattern
Laravel Packages
Performance Optimization
Security Best Practices
Laravel Octane
Laravel Distributed Systems
Observability & Monitoring
Deployment & DevOps
Domina Laravel para tu próxima entrevista
Accede a todas las preguntas, flashcards, tests técnicos, ejercicios de code review y simuladores de entrevista.
Empieza gratis