Development Setup
Prerequisites
Prerequisites:
- PHP 8.1 or higher
- Composer
- Git
- Curl
- For testing: A Magento 2 installation
Setting Up the Development Environment
The repository comes with a ddev configuration for easy local development. If you don't have ddev installed, follow the DDEV installation guide.
Run all commands inside the ddev container. Use ddev ssh to enter the container.
- 
Fork the Repository on GitHub: - Go to https://github.com/netz98/n98-magerun2 and click the "Fork" button to create your own copy of the repository under your GitHub account.
 
- 
Clone Your Forked Repository: git clone https://github.com/<your-username>/n98-magerun2.git
 cd n98-magerun2
- 
Install Dependencies: composer install
- 
Building the PHAR File: See the Build the PHAR file section for details on how to build the n98-magerun2.pharfile.
It is a good practice to setup the upstream repository as a remote in your local clone. This allows you to easily pull updates from the main repository.
You can do this with: git remote add upstream https://github.com/netz98/n98-magerun2.git
Run git fetch upstream to fetch the latest changes from the main repository.
Testing
See the Test Setup section for details on how to set up and run tests.
Deployment
Documentation is deployed automatically via CI/CD on changes to the main branch. For manual deployment or troubleshooting, refer to the Docusaurus documentation or project-specific CI scripts.
Build a phar file
You can build the phar file /var/www/html/n98-magerun2.phar in the ddev Docker web container with:
ddev exec ./build.sh