It is a common use case that you sometimes need to remove an added package from your application.
The remove
command allows you to easily remove a package from your application.
The remove
command takes the package's name or URL as an argument.
You can pass the ssh or https URL of the package to the remove
command.
// Remove using a https URL
phpkg remove https://github.com/{owner}/{repo}
// Remove using a ssh URL
phpkg remove git@github.com:{owner}/{repo}.git
Alternatively, you can define an alias for a specific package using the alias
command and then use the defined alias for removing the package.
phpkg alias package-alias git@github.com:{owner}/{repo}.git
phpkg remove package-alias
Note For more information about the
alias
command, please read this documentation.
When you run the remove
command, the given package will be removed from your package's directory, phpkg.config.json
file, and phpkg.config-lock.json
file.
Note
If you are not sure what path you used to add the package, you can always check the packages section in yourphpkg.config.json
file to see the path.
Let's assume we added the test-runner
package from php-repos/test-runner
.
To remove the package from your application, you can run the following command:
phpkg remove https://github.com/php-repos/test-runner
Using an alias for the package can make it easier:
phpkg alias test-runner https://github.com/php-repos/test-runner
phpkg remove test-runner
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. We aim to unlock this potential by creating tools that help developers harness PHP's full capabilities and extend its power to new heights. To this end, we developed phpkg, a cutting-edge package manager that simplifies 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.