• No results found

Installing the Development Version of MOD

In document MODX the Official Guide (Page 86-88)

If you would like to work with the “bleeding edge” version of MODX (or just keep your version up-to-date with the latest bug-fixes), you can install a development version of MODX from GitHub. The install process is different, and MODX will be less stable. You should only do this if you’re willing to put up with some bugs and contribute to the devel­ opment process by reporting them.

At this writing, the current release version of MODX Revolution can be downloaded from

http: //modx. com/revolution/download/. There will also be several branches of MODX at GitHub. If you want to use any of the development branches at GitHub, it’s important to understand a little bit about both Git and the MODX development process.

The MODX Revolution GitHub repository is a set of “branches” of MODX. There are two permanent branches, master and develop, and there may also be release branches and hotfix branches. Each branch represents a complete, installable version of MODX. Each

branch is made up of a series of commits. Every commit is a “snapshot” of MODX at a given

point in its development. The commit includes all the changes to the MODX files since the previous commit. Collectively, the commits show every change that has ever been made to the code — every change to every file and every file that has been added or deleted. The most recent commit on each branch shows the state of that branch of MODX after all the changes have been applied. It is called the HEAD commit, or just HEAD for short. In Git commands, if no particular commit is specified, the HEAD commit is assumed.

In Git each commit has a kind of ID number called an SHA1. The SHA1 is a 40-digit hexa­ decimal number. Here’s an example:

5ef87c4634181e439762b791c83a3bbb5f2279a3

The SHA1 is actually a hash value computed from the contents of every file in the commit, and it is guaranteed to be unique. If you need to specify a particular commit using its SHA1 (and you rarely do), you only need to enter the first part of it — just enough to distinguish it from the other commits in your repository. Five or six characters are usually enough. The master branch at GitHub will generally correspond to the current release branch. In other words, it matches the files in the .ZIP file available at the main MODX repository. There will also be a branch called develop. In the current development process (which could change), master and develop are the only two permanent branches. The develop

branch is where both new features and regular bug-fixes are added. The HEAD of the develop

branch, then, is the “bleeding edge” version of MODX. You definitely don’t want to be using this branch on a client’s site or any important site of your own.

If a critical bug is discovered in the current release version, a hotfix branch may be created where work will be done to fix the bug. The branch will be named after the bug. Once the bug is fixed, the changes in the hotfix branch will generally be merged into both the develop and master branches, and once it’s clear that the fix worked, the hotfix branch will be deleted.

There may also be feature branches (named after the new feature). If a new Top Menu item, for example, were being added to MODX, the work on it would be done in a feature

branch so that any serious bugs it caused would not interfere with other developers. Once the feature is mature, the feature branch will be merged into the develop branch and the feature branch will be deleted.

When the develop branch is ready for a new release of MODX, a new branch, called a

release branch, will be created from it. The new branch will be named for the upcoming

release version (e.g., release - 2.0.6 - pi). No new features or improvements will be added to the release version. The only changes will be fixes for newly discovered bugs. Any new features or improvements will be added to the develop branch or a feature branch. When it’s time to actually release the new version, a .ZIP file will be created and made available at the main MODX repository. Then, the changes in the release branch will be merged into both the master and develop branches. At that point, the release branch will be frozen and no more changes will be made to it.

You’ll find the MODX Revolution Git repository at: h ttp ://g ith u b . com/modxcms/revolution/

If you go there, you’ll see a “Switch Branches” drop-down menu that will show you all the current branches. If you select one of them, you can look at the most recent commits and see what’s been going on with that branch. If you click on the SHA1 of a particular commit, you’ll see the changes between that commit and the previous commit on that branch. You can download the files for a particular branch directly from GitHub, but it’s much faster to get the files using a Git client, and doing so will allow you to contribute to the development of MODX.

In document MODX the Official Guide (Page 86-88)