This document covers gitignore patterns for the PHP ecosystem, including major web frameworks (Laravel, Symfony, CakePHP, CodeIgniter) and Content Management Systems (WordPress, Drupal, Magento, Joomla, TYPO3). These templates address PHP-specific concerns such as Composer dependency management, framework-specific cache directories, user-generated media, and security-sensitive configuration files.
The repository provides templates for:
PHP platforms share a common reliance on Composer for dependency management and follow conventions for separating versioned application code from runtime artifacts and sensitive environment data.
Sources: Laravel.gitignore1-31 Symfony.gitignore1-53 Drupal.gitignore1-66 community/PHP/Magento2.gitignore1-55 WordPress.gitignore1-48
Laravel projects focus on protecting environment secrets and ignoring generated storage artifacts. It excludes the vendor/ directory Laravel.gitignore1 and the critical .env file Laravel.gitignore19 which contains database credentials and app keys.
| Path | Purpose | Line |
|---|---|---|
/vendor/ | Composer dependencies | 1 |
node_modules/ | Frontend dependencies | 2 |
storage/*.key | Encryption keys | 18 |
.env | Environment configuration | 19 |
public/storage | Symlinked public assets | 11 |
Sources: Laravel.gitignore1-31
Symfony manages a complex directory structure for logs, sessions, and compiled caches across different versions (v2 through v5+).
Sources: Symfony.gitignore1-53
The WordPress template is designed to ignore core system files, allowing developers to version only their custom themes and plugins. It excludes wp-config.php WordPress.gitignore21 to prevent leaking database credentials.
/wp-admin/, /wp-includes/, and /wp-*.php are ignored WordPress.gitignore8-18/wp-content/uploads/ is excluded as it contains non-code media WordPress.gitignore30Sources: WordPress.gitignore1-48
The Drupal template follows official upstream conventions for Drupal 8+ projects Drupal.gitignore1-7 It specifically ignores sensitive settings files like settings.php and services.yml Drupal.gitignore9-10
/vendor Drupal.gitignore57 and web-specific /web/vendor Drupal.gitignore25/web/sites/*/files Drupal.gitignore13Sources: Drupal.gitignore1-66
Magento 1 and Magento 2 have distinct architectures. Magento 1 uses a media/ and var/ structure Magento.gitignore9-39 while Magento 2 incorporates modern patterns like generated/ code community/PHP/Magento2.gitignore53
| Platform | Key Exclusion | Purpose | Line |
|---|---|---|---|
| Magento 1 | /app/etc/local.xml | Database Credentials | 7 |
| Magento 1 | /media/* | Product Images/Media | 9 |
| Magento 2 | /pub/static/* | Compiled Assets | 46 |
| Magento 2 | /generated/* | Interceptors & Factories | 53 |
Sources: Magento.gitignore1-46 community/PHP/Magento2.gitignore1-55
TYPO3 projects often utilize symlinks for core sources. The template ignores these links and the heavy typo3temp/ directory Typo3.gitignore14-23
Zend Framework (Laminas) uses a local configuration pattern. The template excludes config/autoload/*.local.php ZendFramework.gitignore6 and Doctrine ORM proxies ZendFramework.gitignore19
SugarCRM focuses on ignoring the extensive cache/ directory SugarCRM.gitignore9 and custom history/working directories SugarCRM.gitignore12-14
| Pattern Category | Examples |
|---|---|
| Dependency Managers | vendor/, composer.phar, node_modules/ |
| Sensitive Config | .env, wp-config.php, parameters.yml, local.xml |
| Media/Uploads | /media/, /uploads/, /storage/app/public/ |
| Logs/Cache | *.log, /var/cache/, /typo3temp/, /app/storage/ |
Sources: Composer.gitignore1-2 Laravel.gitignore1-19 WordPress.gitignore21-30 Magento.gitignore7-39 Symfony.gitignore2-32