Archive for May, 2009

Gentoo overlay

Created a gentoo overlay. Right now it only has ebuilds for gitphp. You can set it up by doing something like:

git clone http://www.xiphux.com/git/gentoo.git /usr/local/portage/xiphux

And adding to your make.conf:
PORTDIR_OVERLAY="/usr/local/portage/xiphux"

The ebuild will handle changing the permissions of templates_c and will copy gitphp.conf.php.example to gitphp.conf.php, and will allow you to merge changes to gitphp.conf.php using etc-update when you upgrade.

Unfortunately, I don’t know of a good way to make webapp-config handle the templates_c directory, so when you unmerge the package you have to get rid of the templates_c directory manually (since by then the webserver has generated the compiled files in there, so webapp-config won’t remove it since it’s not empty).

GitPHP 0.0.6

Wasn’t really getting any bug reports, so I figured I’d just release.

There’s a README file included now. I’m no master technical writer, but it should explain what you need to know.

The config file is no longer distributed directly; it is distributed as an example file so you don’t overwrite your old config when upgrading. I recommend checking for new options that have been added to the example config that you may not have in your main config.

Changes in this release:

  • Mime type support, to display images inline. 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 or zip
  • templates_c directory created for you already, just change the permissions
  • Single tag view page… somehow I forgot this a long time ago and never noticed since I don’t usually annotate my tags

As usual, release is on the GitPHP page, the repository can be browsed here, and bugs / enhancement suggestions can be reported on Mantis.

I am working on setting up a gentoo portage overlay with a gitphp ebuild, which will install gitphp and handle stuff for you, like the templates_c permissions and config file management using etc-update.

New GitPHP features

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.

Return top