freelock/composer-group-permissions
最新稳定版本:v1.0.0
Composer 安装命令:
composer require freelock/composer-group-permissions
包简介
Composer plugin to ensure group write permissions for installed packages
README 文档
README
A Composer plugin that automatically ensures group write permissions for all installed packages by temporarily setting umask to 0002 during install/update operations.
Problem
When using Composer in shared hosting environments or team development setups, newly created files often lack group write permissions (644 instead of 664), causing permission issues that require manual fixing.
Solution
This plugin automatically:
- Sets umask to 0002 before
composer installandcomposer updatecommands - Restores the original umask after operations complete
- Ensures all vendor files have group write permissions (664/775)
Installation
Global Installation (Recommended)
Install globally to affect all projects:
composer global require freelock/composer-group-permissions
Per-Project Installation
composer require freelock/composer-group-permissions
Usage
Once installed, the plugin works automatically. You'll see verbose output when running composer with -v:
composer install -v # [Group Permissions Plugin] Set umask to 0002 (was 0022) # ... composer operations ... # [Group Permissions Plugin] Restored umask to 0022
How It Works
The plugin hooks into Composer's event system:
pre-install-cmd/pre-update-cmd: Sets umask to 0002post-install-cmd/post-update-cmd: Restores original umask
This ensures all files created during composer operations have group write permissions without affecting the rest of your system.
Requirements
- PHP 7.4 or higher
- Composer 2.0 or higher
Use Cases
- Shared hosting: Multiple users need write access to vendor files
- Team development: Developers sharing code on the same server
- Deployment scripts: Ensuring web server can write to vendor directories
- Docker containers: Maintaining proper permissions across user boundaries
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Created by Freelock LLC to solve permission issues in shared Drupal and WordPress hosting environments.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-25