phpkg
A package manager to boost your code
phpkg is a modern PHP package manager that brings Git-based dependency management to PHP with function-first autoloading. We've brought back all PHP functionalities for you so you can write code however you want.
phpkg is more than a package manager
We've created a tool that has everything you need to build rapid applications.
Functional and OOP
It supports both functional and OOP programming! Autoload namespaced functions alongside classesโno class wrappers needed.
No Intermediate Repo
It uses Git packages directly from repository URLs. No central registry, no middlemanโjust direct Git access.
JIT Compile
It only requires used files to your project, not all of them! Builds are optimized and lean.
Quick Start
# Install phpkg
bash -c "$(curl -fsSL https://raw.githubusercontent.com/php-repos/phpkg-installation/master/install.sh)"
# Try it out
phpkg run php-repos/chuck-norris
# Start a project
mkdir my-app && cd my-app
phpkg init
phpkg add php-repos/observer
phpkg build
New to phpkg? Start with the Getting Started Guide.
Documentation Index
๐ Getting Started
- Installation - Install phpkg on your system
- Getting Started - Your first project with phpkg
- Concepts - Understanding how phpkg works
๐ฆ Core Commands
Package Management
- Add - Add packages to your project
- Remove - Remove packages from your project
- Update - Update packages to new versions
- Install - Install packages from config
Project Management
- Init - Initialize a new phpkg project
- Build - Build your project with production-ready files
- Watch - Auto-rebuild on file changes
- Flush - Clean build artifacts
Standalone Execution
Utilities
- Version - Display phpkg version information
- Alias - Create shortcuts for package URLs
- Credential - Manage Git credentials
- Migrate - Migrate from Composer
โ๏ธ Configuration & Customization
- Customization - Configure phpkg.config.json
- Best Practices - Recommended workflows and patterns
๐ Help & Reference
- Troubleshooting - Solve common issues
- FAQ - Frequently asked questions
- Command Comparison - When to use which command
Why This Matters?
We believe that PHP has enormous untapped potential, and we are dedicated to creating tools that empower developers to harness its full power and capabilities. phpkg unlocks this potential by simplifying the process of using PHP to its fullest extent. With phpkg, developers can take advantage of all that PHP has to offer and build more efficient, scalable, and powerful applications.
What Makes phpkg Different?
| Feature | phpkg | Composer |
|---|---|---|
| Function autoloading | โ Yes | โ No |
| Git-based | โ Direct | โ ๏ธ Via Packagist |
| Central registry | โ No | โ Required |
| Standalone execution | โ Yes | โ No |
| Web app serving | โ Yes | โ No |
| Build system | โ Built-in | โ External tools |
Platform Support
- โ macOS - Fully supported
- โ Linux - Fully supported
- โ Windows - Supported (PHP 8.5+ required, fully tested; later versions may need additional testing)
Next Steps
- Install phpkg on your system
- Follow the Getting Started guide to create your first project
- Explore the commands to understand what phpkg can do
- Read Best Practices for recommended workflows
Need Help?
- Stuck? Check the Troubleshooting Guide
- Questions? See the FAQ
- Best practices? Read Best Practices
Happy coding with phpkg! ๐