New way of specifying projects and categories
author Chris Han
()
committer Chris Han
()
commit a3e173bafcf318765ae0bca60b3a48b6f287ec4f
tree 362711b4d48a4c5bf02fe0a068fe755e2ca5a061
parent 823e01cc91db03681ac0035beb0755c7a021d4d1
New way of specifying projects and categories

This changes the way projects are specified with categories in an array.
There is a new config file in the config directory, projects.conf.php,
where the projects are listed using the git_projects array. In order to
make the transition easier for upgrading users without breaking
everything when they upgrade, this will allow a fallback to the legacy
method. If the file projects.conf.php exists, it will read that using
the new array format. If it doesn't exist, it will continue to use the
legacy array format that was specified in the main gitphp.conf.php.

This change was necessary because the previous format was limited to
only a single piece of metadata for a project - one category as a
string. Now, with this format, an arbitrary amount of metadata can be
specified for any project - so future enhancements can take advantage of
this and it will be very easy to add extra metadata.

This uses PHP's standard syntax for specifying multidimensional arrays.
It is admittedly more complicated than the old method because you have
to get all the syntax with commas and array() declarations correct,
which may be difficult for non-PHP programmers. I considered doing an
actual config file parser; however since this file is loaded every
single time you load any page, I wanted it to be as lightweight as
possible, and nothing is more lightweight than PHP's native syntax.
config/gitphp.conf.php.example
config/projects.conf.php.example [ new file with mode 0644 ]
include/git/ProjectList.class.php
include/git/ProjectListArray.class.php
include/git/ProjectListArrayLegacy.class.php [ new file with mode 0644 ]
index.php
comments