Loading repository data…
Loading repository data…
Fulmenef / repository
Magephi's source code. This is where development happens. Check https://github.com/fulmenef/magephi for the distribution repository.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Magephi is a Symfony based PHP CLI designed to manage Magento 2 projects environment.
Its main functionality are the installation/start/stop of your environment but it can also initialize a Magento 2 project with its environment, give you access to services, verify your environment match the prerequisites, import a database etc.
For now Magephi has been only tested on Mac with the environment docker-magento2.
curl -sL https://github.com/Fulmenef/magephi/releases/latest/download/magephi.phar --output /usr/local/bin/magephi
chmod +x /usr/local/bin/magephi
The application will display a notice when an update is available. To download it, just use the update command:
magephi update
# List Magephi commands
magephi
# Execute a specific command
magephi xxxxx
# Display the help message of a specific command
magephi xxxxx --help
# List all available commands (i.e. Symfony included)
magephi list
magephi prerequisites to check if your system match the prerequisites to use the environment.magephi import to import a database and update the urls.magephi update to update Magephi.magephi create Initialize a new project with the environment. See here for more details about the command.magephi install to install the environment (build + start).magephi status to give you a quick look on the project status (equivalent to docker-compose ps and mutagen list).magephi start to start the environment.magephi stop to stop the environment.magephi cache to flush Magento and Redis cache.magephi uninstall to fully uninstall the environment. This will remove volumes and container but not the files on your local system.magephi backup|restore Generate or restore a backup of your database and environment configuration.magephi php|mysql|nginx|redis to connect to containers.magephi build to build the containers. The docker/local/.env file must have been filled before.magephi magento:install to install Magento after you have installed the environment.You can initialize a project with the magephi create. If you are in an empty directory, the project will be installed inside it,
if not you'll be asked for the project name and a directory with that name will be created and used as work directory.
At the same time as the Magento 2 dependency, some development dependencies are added.
Also, a custom .gitignore is set, you can have a look of the content here.
The following will run PHPCsFixer and PHPStan on each PHP and PHTML files, Stylelint for each LESS files and Eslint for
javascript files each time you run a git commit.
// To be placed at the end of the package.json
"husky": {
"hooks": {
"pre-commit": "lint-staged --relative --shell"
}
},
"lint-staged": {
"!(app/etc/*).php|*.phtml": [
"php ./vendor/bin/php-cs-fixer fix --config .php_cs",
"php ./vendor/bin/phpstan analyze --level=max --no-progress"
],
"app/code/YourVendor/**/*.less|app/design/frontend/YourVendor/**/*.less": [
"php ./node_modules/.bin/stylelint --fix"
],
"app/code/YourVendor/**/*.js|app/design/frontend/YourVendor/**/*.js": [
"php ./node_modules/.bin/eslint --fix"
]
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
If you would like to see your environment managed by Magephi, please open an issue.