Monday, February 20, 2017

Grav - GPM

The GPM stands for Grav Package Manager which is used to install, update, uninstall and list the available plugins on the Grav repository. GPM executes the commands using command line interface such as terminal or cmd.

You can access CLI very easily. On Windows you can access through cmd, on Mac you can access through Terminal and on Linux you can use shell. In windows, you can't use UNIX style commands. To use these just install the msysgit package which provides GIT and GIT BASH and provides UNIX style commands on Windows.
To list the available commands on the Grav repository type the command as:
$ bin/gpm list
Grav GPM You can help the commands by adding help to the line as shown below:
$ bin/gpm help install
You can find the version of PHP on the command line interface by using below command:
$ php -v
Grav GPM

How does it work?

When you run the commands on command line interface, GPM automatically downloads the required data from the GetGrav.org site. It includes all the details of available packages and also determines which packages needs to be installed and which packages needs to be updated.
When you are downloading the packages from the repository, the Grav repository get cached locally and no request will be able to contact GetGrav.org server after the cache has been generated.
Some commands comes with the --force (-f) option which forces to re-fetch the repository. Using this option, there is no need to wait for 24 hours cycle before cache gets cleared.

Commands

You can download the available packages from the Grav repository using some commands. To make use of the command, open your terminal and navigate to your root of the Grav folder and type as bin/gpm <command>.

Index

The index command is used to list the available plugins, themes in the Grav repository. Use the below command in your terminal to list out the available resources.
$ bin/gpm index
Grav GPM The each line defines name of the plugin or theme, slug, version of plugin or theme and also display whether it is installed or not.

Info

The info command is used to display the information about package such as author, version, date and time of last updated, repository of package, download link of package, license information etc.
Grav GPM

Install

As the name implies the install command installs the required resources for the package from the Grav repository. You can use the below command to install the required package.
$ bin/gpm install package_name
Grav GPM If you try to install already installed package, then it informs what to do next.
Grav GPM If you type Y, it will overwrite on already installed package and if type N, it will abort the installation process.

Update

The update command informs which packages needs to be update. Suppose if all packages are up to date, then it will say nothing to update.
$ bin/gpm update
Grav GPM

Self-upgrade

The self-upgrade command is used to upgrade the Grav to latest version. Use the below command to upgrade the Grav.
$ bin/gpm self-upgrade
If you are using latest version of Grav, then it will display a message saying "You are already running the latest version of Grav" along with released date and time as shown in the screen.
Grav GPM

No comments:

Post a Comment