I have some new GitPHP features developed. They are in the current git repository and just need some more testing time before a new release can come out (hint, hint – testing this and reporting bugs would help me a great deal). Off of the top of my head, changes are:
- Mime type support. When viewing a blob, if it recognizes the mime type as an image, it will embed and display the image using a data uri rather than dumping the binary content. This is only done for images, though – there isn’t a good way to embed other binary file formats. It supports pecl-fileinfo (which was merged into PHP in 5.3), the “file” command on *nix machines, and just checking the file extension. Based on work by Trevino
- Searching of commit logs, authors, committers, filenames, and file contents
- Blob diffs show the filenames instead of the hashes to be more readable
- Fixed blank entries that appeared at the end of the log/shortlog
- Added a link to the tree from the main project list
- Some performance fixes for projects with many commits
- Snapshots can be sent as tar.gz now
- templates_c directory created for you now, you just need to change the permissions
Also, I’m going to be writing up a README, because it looks like the installation and the handling of templates_c has really confused people.
I’ve seen suggestions of symlinking templates to templates_c, which is not right at all, they are not the same thing. (I saw this posted on a Chinese website, and I don’t know Chinese, so I can’t tell the person the right way)
Your templates directory holds the templates that I’ve written – essentially the layout of the page, without any of the data in it. Your templates_c directory contains compiled templates – that is, smarty has taken the templates (*.tpl) from the templates directory, inserted all the php code it takes to make them work, and stored the php file that resulted from that template in templates_c, for use when serving up pages. Compiled templates are temporary. Actual templates, tpl files, are not temporary, they were written by me and come with the distribution. If you symlink the two directories together, you have one directory with a mess of compiled and uncompiled templates.
I admit that a readme would have explained this a little better, which is why I’m doing it for the next version. Here is how your directory structure is supposed to look:
gitphp/index.php
gitphp/config/gitphp.conf.php
gitphp/include/*.php
gitphp/templates/*.tpl <- These are the templates written by me that come with gitphp
gitphp/templates_c/*.tpl.php <- These are the compiled templates that get written, so this directory must be writable by the web server
If you don’t have a global copy of smarty installed, you can install it locally:
gitphp/smarty/Smarty.class.php
gitphp/smarty/internals/*
gitphp/smarty/plugins/*
If you want to use geshi:
gitphp/geshi/geshi.php
gitphp/geshi/geshi/*.php
I’m planning on releasing the new version maybe this weekend or next. Whatever testing you can do with the snapshot before then will help everyone, because that means less bugs in the actual release. You can report them using Mantis.

One Comment
Hi, I just wanna to say I have modified your code, now there is a favicon, you can change the name of projects and the description. I didn’t have much time to see the whole code, but did you enabled the cache with smarty?
It would be great to have pre-created package feature because if you have a big project when you click snapshot you need to wait some secs.
In kernel/git I saw that they have the packages instantly.
If you wanna talk with me, send me an email to my address!
Bye!