<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>xiphux</title>
	
	<link>http://www.xiphux.com</link>
	<description />
	<lastBuildDate>Wed, 08 Sep 2010 03:58:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/xiphux" /><feedburner:info uri="xiphux" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item>
		<title>More GitPHP Changes</title>
		<link>http://www.xiphux.com/2010/09/07/more-gitphp-changes/</link>
		<comments>http://www.xiphux.com/2010/09/07/more-gitphp-changes/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 03:58:31 +0000</pubDate>
		<dc:creator>xiphux</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gitphp]]></category>

		<guid isPermaLink="false">http://www.xiphux.com/?p=698</guid>
		<description><![CDATA[Well, the hell I&#8217;ve been dealing with at work finally wound down last week. That means I&#8217;m now starting to have some time to start working my way back into GitPHP. I&#8217;m planning on officially releasing the rewrite sometime soon &#8211; tentatively I&#8217;m thinking sometime this month. I&#8217;m giving it a last minute stabilization period [...]]]></description>
			<content:encoded><![CDATA[<p>Well, the hell I&#8217;ve been dealing with at work finally wound down last week.  That means I&#8217;m now starting to have some time to start working my way back into GitPHP.</p>
<p>I&#8217;m planning on officially releasing the rewrite sometime soon &#8211; tentatively I&#8217;m thinking sometime this month.  I&#8217;m giving it a last minute stabilization period to eliminate any bugs I&#8217;ve come across, and add a couple small and easy features.</p>
<p>Since this isn&#8217;t a release changelog, I&#8217;m not going to list out the bugfixes &#8211; you can always look at <a href="http://gitphp.xiphux.com/index.php?p=php/gitphp.git&#038;a=shortlog">the log</a> for that.  But there are a few features currently implemented in the master branch that you&#8217;ll probably be interested in knowing about:</p>
<h2>Javascript</h2>
<p>I finally got around to starting to add a couple of the javascript features I&#8217;ve always wanted to add.  These are the first steps towards the actual next generation of the user interface that I intended to do, after the architectural rewrite.  I used the <a href="http://jquery.com/">jQuery</a> javascript library &#8211; I&#8217;ve worked with it before and I&#8217;m familiar with it.</p>
<p>I started with the two things that bugged me the most usability wise &#8211; so these are primarily supposed to be functional improvements (although admittedly some of the animation effects I used are more for cool looks rather than pure functionality&#8230;)</p>
<ul>
<li>Commits in the shortlog, project summary, and blame pages now give much more useful info when you mouse over them.  Previously they used the browser&#8217;s built-in tooltips (using the title attribute) to display the full first line of the commit message.  This was clumsy because all formatting was discarded, it can take several seconds for the tooltip to pop up, and it was small and hard to read.  Now it uses tooltips from the <a href="http://craigsworks.com/projects/qtip/">qTip</a> jquery plugin.  The tooltip shows the author, committer, and <strong>full</strong> commit message.  It asynchronously loads in the background with ajax when you first hover over the commit, to avoid increasing the size of the initial page.  The tooltip content is defined by a template so it&#8217;s customizable, and the content is cached like everything else.</li>
<li>Blame data can now be loaded asynchronously into the blob page.  Previously when you clicked the blame link on a blob page, you got pretty much exactly the same page, but with an extra column of blame data.  A lot of this was unnecessary work and time.  So now, when you click the blame link, it uses ajax to pull the blame data from the server, and inserts it in the right place right next to the blob, without having to load all the blob content again.  This blame data is also cached.</li>
</ul>
<p>Both these features are running now on the <a href="http://gitphp.xiphux.com">GitPHP instance</a> on this site, if you want to try them out.  They are designed to degrade gracefully &#8211; so without javascript you&#8217;ll get the old style tooltips, and the blame link will take you to the normal blame page.  Also, if you don&#8217;t want them for your instance at all &#8211; you don&#8217;t like them, you prefer not using javascript to lighten the footprint of your site, or you&#8217;re a grumpy old man &#8211; you can turn them off using a config option, and they will degrade the same way for everybody.</p>
<h2>Syntax highlighting on the blame page</h2>
<p>Previously, the blame page didn&#8217;t do any syntax highlighting, due to limitations in the HTML given to me by GeSHi.  I found a way around it, so the standard blame page now does syntax highlighting just like the blame page.  Note that this only applies if you&#8217;re not using the javascript blame feature described above.</p>
<h2>New project array format</h2>
<p>I&#8217;m changing the way projects are defined with categories in the git_project array.  The previous method was extremely limited, and only allowed definition of a single piece of metadata &#8211; one category &#8211; for each project.  I have at least one feature in mind that will depend on more metadata than that, so I&#8217;m changing to a new project array format.  The whole $git_projects definition is being moved to a new file &#8211; config/projects.conf.php.  This makes the config cleaner, by putting options in one file and projects in another.  The new format uses a multidimensional php array in such a way that an arbitrary amount of metadata can be added for a project.  Right now there&#8217;s no extra data supported yet &#8211; just the one category &#8211; but this is just in preparation.</p>
<p>Admittedly the new format is a tiny bit harder to set up because it relies on php&#8217;s array syntax &#8211; so you need to get all the commas and array() calls right.  You can look at config/projects.conf.php.example for an example of how it&#8217;s supposed to look.  I contemplated making a config parser to simplify the format, but since this file gets loaded every time you load any page, I chose to keep the performance hit as light as possible and not try to parse anything.</p>
<p>In order to make upgrading easier, the system still supports the old method.  If the projects.conf.php file exists, it will use that to load the new format.  If it doesn&#8217;t exist, it will fall back to the older method loaded from gitphp.conf.php.  So you can keep using the old method, and whenever you&#8217;re ready, copy projects.conf.php.example to projects.conf.php and set it up.</p>
<h2>Features from Calen Pennington at <a href="http://www.wirelessgeneration.com/">Wireless Generation</a></h2>
<ul>
<li>When using the directory list method of listing projects (no projects defined in the config, to crawl the projectroot for projects), the projects will automatically be categorized by the directory they&#8217;re in</li>
<li>When using the directory list method of listing projects, this method can now respect the magic file git-daemon-export-ok, and only list projects that have that magic file in them.  (see the git-daemon man page for details on that file)  Whether that exclusion is done is set by a config option, in order to avoid breaking existing installs on upgrade.</li>
</ul>
<h2>Feature from Tejas Dinkar</h2>
<ul>
<li>Now, in the tree view, a snapshot archive can be generated for any sub-tree (a single subdirectory of your project)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.xiphux.com/2010/09/07/more-gitphp-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I’m still here</title>
		<link>http://www.xiphux.com/2010/08/09/im-still-here/</link>
		<comments>http://www.xiphux.com/2010/08/09/im-still-here/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 23:45:13 +0000</pubDate>
		<dc:creator>xiphux</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[gitphp]]></category>

		<guid isPermaLink="false">http://www.xiphux.com/?p=692</guid>
		<description><![CDATA[Just a heads up that: Yes, I&#8217;m still around No, I haven&#8217;t forgotten that I rewrote gitphp Yes, I still plan on releasing the rewrite I&#8217;ve had a really huge increase in the amount of stuff I have to deal with at work these past four months (I have the government to thank for that&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Just a heads up that:</p>
<ul>
<li>Yes, I&#8217;m still around</li>
<li>No, I haven&#8217;t forgotten that I rewrote gitphp</li>
<li>Yes, I still plan on releasing the rewrite</li>
</ul>
<p>I&#8217;ve had a really huge increase in the amount of stuff I have to deal with at work these past four months (I have the government to thank for that&#8230; if you follow HIT, you&#8217;ll know exactly what I&#8217;m talking about when I say the words &#8220;meaningful use&#8221;).  It&#8217;s been tough for me to get back to my personal development, but I still do intend to get back to it when I can.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiphux.com/2010/08/09/im-still-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GitPHP rewrite</title>
		<link>http://www.xiphux.com/2010/03/29/gitphp-rewrite/</link>
		<comments>http://www.xiphux.com/2010/03/29/gitphp-rewrite/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 02:26:54 +0000</pubDate>
		<dc:creator>xiphux</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gitphp]]></category>

		<guid isPermaLink="false">http://www.xiphux.com/?p=684</guid>
		<description><![CDATA[The gitphp rewrite has been merged from its development branch into the master branch. It&#8217;s not 100% complete, but most of the work is done. There haven&#8217;t really been any UI changes yet, this is all backend stuff at the moment. I&#8217;m sure it&#8217;s still pretty buggy, so I encourage the brave to grab a [...]]]></description>
			<content:encoded><![CDATA[<p>The gitphp rewrite has been merged from its development branch into the master branch.  It&#8217;s not 100% complete, but most of the work is done.  There haven&#8217;t really been any UI changes yet, this is all backend stuff at the moment.  I&#8217;m sure it&#8217;s still pretty buggy, so I encourage the brave to grab a snapshot and try it out &#8211; the more bugs we take care of now, the less are in the actual release.  If you&#8217;re not that brave, the copy running on my site right now at <a href="http://gitphp.xiphux.com">http://gitphp.xiphux.com</a> is running the rewrite snapshot code, so you can play around with that if you want.  It&#8217;s still going to be some time before the next release; a complete code change like this needs a significant amount of testing time.</p>
<p>The rewrite uses an exception catching system to display error messages to the user.  Some of these are intentional &#8211; for example, displaying that a search had no results.  However, for the moment, I have disabled this exception catch in order to debug actual issues easier &#8211; errors will be a lot less friendly but will show a lot more useful debugging info.  This exception catch will be re-enabled before release.</p>
<p>As a side effect of the rewrite, a couple small &#8220;features&#8221; did make it into the rewrite right now:</p>
<ul>
<li>The configuration management operates on a merge system now, in that configuration values specified in gitphp.conf.php will be merged over and replace default values.  What that means is that now the config file doesn&#8217;t have to specify all the config values in order to work properly &#8211; it only has to specify the values that you want to change.  In fact, you&#8217;ll notice that this is now reflected in the example config; the example now only has config values that almost everyone cares about: the projectroot config value (because it&#8217;s necessary), the git projects list (because it&#8217;s frequently used), and the caching option (because really everyone should be using caching, I just can&#8217;t turn it on by default because it requires setting up a cache directory).  Every other config option has been moved to the gitphp.conf.defaults.php file, which lists all the config values and their defaults (formerly what the example used to do).  The defaults file isn&#8217;t usable as a real config; the idea is that if you want to change a config value, you copy it from the defaults file into your gitphp.conf.php file and set it appropriately.  This way users can keep the amount of noise in their config files to a minimum.  If you have suggestions for other very frequently used config options that are good candidates to put in the example file, let me know.</li>
<li>Previously, ref tags (the little yellow labels that list heads/tags for a commit) would not distinguish between tags and heads.  Now, tags and heads are different colors, and clicking on the little badges will direct you to an appropriate page for that ref (the shortlog for heads, the tag page for tags).</li>
<li>Turning on debugging outputs a wealth of timing and memory usage information &#8211; probably way more than you care about.  This output also breaks any non-html output (snapshots, rss, opml, etc).  In other words, turn debugging off if you were using it.</li>
<li>Trees display file sizes by blobs.  At the moment they&#8217;re not right-aligned though, I need to fix that (<strong>Update 2010-03-30</strong>: also it requires git 1.5.3 or greater, as I found out the hard way just now when my copy hosted on this website has been crashing on the tree view because dreamhost only runs git 1.4.4.4.  A fix was added to make it fallback gracefully on older versions)</li>
<li>File searching shows the line number by matching lines</li>
</ul>
<p>I have a variety of ideas that I want to implement.  I don&#8217;t know how many of these will get in before the next release, but some ideas are:</p>
<ul>
<li>Using javascript tooltip bubbles to show more information &#8211; for example, mousing over a commit title to get the full commit message in a more readable form than the current method of using the title attribute</li>
<li>GeSHi syntax highlighting on the blame page</li>
<li>Loading blame info inline into the blob page using javascript and ajax, rather than going to a separate page</li>
<li>I18n</li>
<li>Allowing drilling down into a tree using javascript and ajax without having to navigate to a different tree page</li>
</ul>
<p>Other suggestions are welcome.</p>
<p>The rest of this post is about the architectural design and decisions of the OOP rewrite.  If you don&#8217;t care, you can stop reading now.</p>
<p>The idea of the rewrite was to separate the business logic from the UI using a model-view-controller system.  I followed this basic methodology:</p>
<ul>
<li><strong>Model</strong>: a library of objects representing the various pieces of a git repository &#8211; project, commit, tree, blob, etc.  In directory include/git</li>
<li><strong>View</strong>: the smarty template</li>
<li><strong>Controller</strong>: connector class that reads the parameters for an action, instantiates the proper model objects, and passes them to the template system (smarty).  In include/controller</li>
</ul>
<p>The git data model is pretty self-explanatory.  Most objects represent pieces of a git repo you&#8217;re familiar with.  Any objects representing a hash in the repository inherit from the GitObject class, which is an abstract class representing a hash.  The ProjectList* classes represent a list of projects, with ProjectList being the factory and ProjectListBase being the abstract base class that the various projectlist implementations (directory list, gitosis file, categorized array) extend.</p>
<p>Controllers are also pretty straightforward.  All controllers inherit from ControllerBase, the base class which does a lot of the generic implementation, such as setup of template variables used in all templates, handling displaying a cached template vs loading the data for rendering, etc.  The Controller class itself is the &#8220;supercontroller&#8221; that maps the action to a given controller class.  Controllers can also be flexible and change things based on parameters &#8211; for example, shortlog and log now both use the same data objects and therefore use the same controller &#8211; just that the controller decides whether to use the shortlog or the log template depending on a parameter.</p>
<p>This is not a 100% pure MVC system &#8211; to minimize the amount of processing the controller does, the template has to know some things about how the data objects work.  For example, if the template knows how to get the commit message out of a commit object, or get the root tree from a commit object, it doesn&#8217;t really make sense to make the controller do the extra work of pulling that out beforehand.  Really, this is because for this project I am both the programmer and the template author, so I don&#8217;t have to pretend that the template author doesn&#8217;t know anything about the data model.</p>
<p>Apoplectic MVC purists can leave now.</p>
<p>That said, if you can get over that, any constructive criticism on any part of the design is welcome.  I did take shortcuts in the data model in a couple places, after all.</p>
<p>Performance testing is showing certain actions to be slower and others to be faster.  In particular, pages that can make repeated use of a single object (project summary, commit, etc) are showing speedups because of the way objects only load data from the repository on demand and cache it.  At the same time, code that makes use of many different objects (for example, all the commit objects used to display all the entries on a log page) are showing slowdowns because it takes php time to create those objects.  In the end, it balances out.  Of course, caching still makes much of this pretty much moot.</p>
<p>Give the new code a test &#8211; play around with using the rewritten code, have a look at the code if you&#8217;re programming inclined and offer suggestions.  Heck, if you use <a href="http://gitphp.xiphux.com">http://gitphp.xiphux.com</a> you can do both at the same time.  Let me know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiphux.com/2010/03/29/gitphp-rewrite/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Updated GitPHP 0.1.1 packages</title>
		<link>http://www.xiphux.com/2010/02/18/updated-gitphp-0-1-1-packages/</link>
		<comments>http://www.xiphux.com/2010/02/18/updated-gitphp-0-1-1-packages/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 23:52:45 +0000</pubDate>
		<dc:creator>xiphux</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gitphp]]></category>

		<guid isPermaLink="false">http://www.xiphux.com/?p=681</guid>
		<description><![CDATA[Oops, I seem to have forgotten to actually add GeSHi to the gitphp repo previously, which means the previous 0.1.1 packages didn&#8217;t have GeSHi in them. I&#8217;ve added it and updated the packages on the gitphp page.]]></description>
			<content:encoded><![CDATA[<p>Oops, I seem to have forgotten to actually add GeSHi to the gitphp repo previously, which means the previous 0.1.1 packages didn&#8217;t have GeSHi in them.  I&#8217;ve added it and updated the packages on the gitphp page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiphux.com/2010/02/18/updated-gitphp-0-1-1-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GitPHP 0.1.1, and some notes on future direction</title>
		<link>http://www.xiphux.com/2010/02/14/gitphp-0-1-1-and-some-notes-on-future-direction/</link>
		<comments>http://www.xiphux.com/2010/02/14/gitphp-0-1-1-and-some-notes-on-future-direction/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 01:32:53 +0000</pubDate>
		<dc:creator>xiphux</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gitphp]]></category>

		<guid isPermaLink="false">http://www.xiphux.com/?p=667</guid>
		<description><![CDATA[This release has a couple new features and bugfixes, and starts a bit of a change in direction with the development of the project. First, features: Support for specifying a project list file, rather than listing out projects manually in the config file. It was done with Gitosis in mind, but will work with any [...]]]></description>
			<content:encoded><![CDATA[<p>This release has a couple new features and bugfixes, and starts a bit of a change in direction with the development of the project.</p>
<p>First, features:</p>
<ul>
<li>Support for specifying a project list file, rather than listing out projects manually in the config file.  It was done with Gitosis in mind, but will work with any flat file of projects.  Thanks to Jonathan Kolb</li>
<li>Switch to using GeSHi&#8217;s CSS mode to make highlighted blob support more lightweight (less traffic)</li>
<li>Basic blame support.  This is available as a link on any blob page to see the blame view for that file (if there&#8217;s somewhere else you would like the link, let me know).  This is just the standard git blame algorithm, it doesn&#8217;t do any of the more fancy pickaxe stuff such as added/deleted lines.  Also, currently blame view does not do any syntax highlighting with GeSHi &#8211; it&#8217;s actually trickier than it sounds because of the way GeSHi works</li>
<li>Smarty and GeSHi are now included with GitPHP so you don&#8217;t have to install it yourself &#8211; more on this below</li>
</ul>
<p>Bugfixes:</p>
<ul>
<li>Fix a bug that prevented filesearch from working, thanks to Christiaan Kortekaas</li>
<li>Fix a bug that caused RSS to generate an error for a project with a small number of commits, thanks to Zaran</li>
<li>Fix a security hole that allowed users to access any project using the p= parameter, even if it was not listed in the project list.  Thanks to Jonathan Kolb</li>
</ul>
<p>Just a note that some files have been moved around for organizational purposes (in particular, images, CSS, and documentation was moved into their own directories, rather than having them float around in the root), so if you&#8217;re upgrading, I would backup your config, delete your current install, then install the new version and replace your config so you don&#8217;t have unused files hanging around.</p>
<p>As always, release is on the <a href="http://www.xiphux.com/programming/php/gitphp/">GitPHP</a> page, and bugs can be reported on <a href="http://mantis.xiphux.com">Mantis</a>.</p>
<p>For future releases, I am aiming for making everyone&#8217;s lives easier with some significant changes.  In case you&#8217;re a tl;dr person, I will bold key points.</p>
<p><strong>Ease of setup</strong><br />
Currently, GitPHP is not easy to setup.  You have to read through a long list of configuration options to get things set up, and you have to install smarty on your own, as well as (if you choose) GeSHi.  One thing I&#8217;ve discovered, after developing commercial software for a year and a half, is that <em>users don&#8217;t read instructions</em>.  Despite the fact that I&#8217;ve written up a README and explained how to do everything, I&#8217;m willing to bet there&#8217;s been at least one user that tried to install GitPHP, gotten an error that Smarty isn&#8217;t found, then gave up.  There was even a fork by someone at one time to remove Smarty support.  While I have nothing against forks (I&#8217;ve seen at least two forks of GitPHP), I couldn&#8217;t really understand why someone would want to remove support for Smarty other than the fact that they didn&#8217;t want to have to install it themselves as a dependency.  If it&#8217;s completely internal to the project, it shouldn&#8217;t matter whether you&#8217;re using smarty or any other template engine.  Besides, Smarty is what provides the caching framework that GitPHP uses.<br />
Previously, I always excluded Smarty and GeSHi because I wanted to keep the package lightweight and allow users to choose what versions they wanted to use (in keeping with Unix style).  But since this has led to so much confusion for people, <strong>I am now including Smarty with GitPHP</strong> (in a &#8216;lib/&#8217; directory).  The example config now points to this smarty install by default.  <strong>GeSHi is also included</strong> in this lib directory, and the example config points to this copy and enables GeSHi by default.  Eventually the config options will be removed from the example config, or at least moved away from the main config options.  The config options themselves will probably never go away because it&#8217;s useful to be able to point to a shared smarty or geshi instance, but at least they&#8217;ll be hidden away from the average user and not be required options.<br />
This is probably the best I can do as far as making Smarty transparent.  You still need to set templates_c writable by the server because I can&#8217;t control permissions on a directory in a tarball.<br />
<strong>I will also be evaluating other configuration options for removal in the future</strong> from the example config so you don&#8217;t have to read over them if I can provide reasonable defaults.  No current options will be removed completely, but like Smarty and GeSHi, they may be hidden away by default.  The only config option a user must be required to set up is the project root, because I&#8217;m not psychic and I don&#8217;t know where you&#8217;ve made your projects available.</p>
<p><strong>Ease of maintainability</strong><br />
For the past few years, I&#8217;ve hated the GitPHP codebase.  GitPHP was written in 2005, back when PHP 4 was still commonplace and PHP 5 was not widely deployed for everyone.  So at the time, when I started the project, I wrote it as a very large collection of functions (like a C program), because:</p>
<ul>
<li>I wanted it to work on PHP4, which most people (including me) were still using at the time</li>
<li>I was basing it on Gitweb, which is a single perl file.  Perl is not exactly organized, and neither was the Gitweb code.  (it still isn&#8217;t)</li>
<li>I was still relatively inexperienced with PHP</li>
</ul>
<p>However, after five years of changes and tweaking, it&#8217;s ended up as a train wreck of spaghetti code.  I&#8217;ve found myself having to violate the DRY (don&#8217;t repeat yourself) principle all over the place just to fix simple bugs, and adding a new feature (blame) was a lot messier than it should have been.<br />
Therefore, I am going to be rewriting all the internal code of GitPHP.  Because PHP 5 is widespread now (and PHP 4 is end of life), I can take advantage of PHP 5&#8242;s much better (though still not quite perfect) object oriented programming support.  This means I can use things inherent to object oriented programming like patterns, code reuse, and loading data by git commands only on demand and caching it in objects to minimize the number of git commands executed.<br />
For people looking at the code (me, and maybe anyone doing a bugfix), this will eventually make your job a lot easier.  For users, what this means is that <strong>at some point &#8211; maybe even as soon as the next release &#8211; GitPHP will stop working on PHP 4</strong>.  I&#8217;ve already started, but as a rewrite of pretty much the entire application, it&#8217;s going to take quite a while.  Depending on how long it takes me, it&#8217;s possible that the next release will have a half-half codebase.  We&#8217;ll see.</p>
<p><strong>Ease of use</strong><br />
The current GitPHP interface is based on Gitweb (obviously).  While the gitweb interface works fairly well, there are also places where I&#8217;ve found using it to be fairly clumsy.<br />
Also, currently GitPHP uses no javascript for browser compatibility reasons.  However, there have been a number of times where I would have liked to use javascript to make life easier for someone using the site.  As compatibility between browsers gets better, using javascript <em>in a compatible but also degradable way</em> looks more and more feasible, so <strong>I will be looking into ways to make the user interface of GitPHP more flexible in the future &#8211; implementing javascript, and partially departing from the Gitweb look</strong>.  It&#8217;s not going to look like a radically different application or anything, but it will probably stop adhering so closely to Gitweb.  This is a long term thing though; I probably won&#8217;t start this until I&#8217;ve at least addressed the other two points, rewriting the core and making the install easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiphux.com/2010/02/14/gitphp-0-1-1-and-some-notes-on-future-direction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GitPHP 0.1.0</title>
		<link>http://www.xiphux.com/2009/11/10/gitphp-0-1-0/</link>
		<comments>http://www.xiphux.com/2009/11/10/gitphp-0-1-0/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 02:43:33 +0000</pubDate>
		<dc:creator>xiphux</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gitphp]]></category>

		<guid isPermaLink="false">http://www.xiphux.com/?p=663</guid>
		<description><![CDATA[This release fixes a major security hole; upgrading is recommended as soon as possible. Changes: Security fix: A user could perform a directory traversal using a crafted relative path (using .. and a null byte) to read an arbitrary file on the server Allow display of clone/push urls for projects Release is on the GitPHP [...]]]></description>
			<content:encoded><![CDATA[<p>This release fixes a major security hole; upgrading is recommended as soon as possible.</p>
<p>Changes:</p>
<ul>
<li><strong style="color:red;">Security fix:</strong> A user could perform a directory traversal using a crafted relative path (using .. and a null byte) to read an arbitrary file on the server</li>
<li>Allow display of clone/push urls for projects</li>
</ul>
<p>Release is on the <a href="http://www.xiphux.com/programming/php/gitphp/">GitPHP</a> page, and bugs can be reported on <a href="http://mantis.xiphux.com">Mantis</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiphux.com/2009/11/10/gitphp-0-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GitPHP 0.0.9</title>
		<link>http://www.xiphux.com/2009/10/24/gitphp-0-0-9/</link>
		<comments>http://www.xiphux.com/2009/10/24/gitphp-0-0-9/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 02:49:51 +0000</pubDate>
		<dc:creator>xiphux</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gitphp]]></category>

		<guid isPermaLink="false">http://www.xiphux.com/?p=659</guid>
		<description><![CDATA[This is just a small bugfix release. Changes: PHP 5.3 fixes (avoid assigning object references, switch to perl compatible regular expressions since the posix extended regex functions are deprecated) &#8211; patch by Khee Chin On the project list, the project description links to the project page like gitweb &#8211; patch by Khee Chin Packed ref [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a small bugfix release.</p>
<p>Changes:</p>
<ul>
<li>PHP 5.3 fixes (avoid assigning object references, switch to perl compatible regular expressions since the posix extended regex functions are deprecated) &#8211; patch by Khee Chin</li>
<li>On the project list, the project description links to the project page like gitweb &#8211; patch by Khee Chin</li>
<li>Packed ref support &#8211; based on work by Khee Chin</li>
<li>Fixed display of non-english UTF-8 characters (they used to appear garbled)</li>
<li>Disabled smarty&#8217;s template compile check in releases for a small performance boost (smarty used to constantly check if a template was modified, something that&#8217;s unnecessary in releases put into production and is only useful during development)</li>
</ul>
<p>Release is on the <a href="http://www.xiphux.com/programming/php/gitphp/">GitPHP</a> page, and bugs can be reported on <a href="http://mantis.xiphux.com">Mantis</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiphux.com/2009/10/24/gitphp-0-0-9/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>GitPHP 0.0.8</title>
		<link>http://www.xiphux.com/2009/07/25/gitphp-0-0-8/</link>
		<comments>http://www.xiphux.com/2009/07/25/gitphp-0-0-8/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 05:41:39 +0000</pubDate>
		<dc:creator>xiphux</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gitphp]]></category>

		<guid isPermaLink="false">http://www.xiphux.com/?p=646</guid>
		<description><![CDATA[This release does not have many major changes for end users. However, there are a number of significant changes under the hood: Major features: Caching By request&#8230; GitPHP now makes use of Smarty caching to cache the output of any action &#8211; this includes all pages, blobs, diffs, searches, and even snapshots. There are new [...]]]></description>
			<content:encoded><![CDATA[<p>This release does not have many major changes for end users.  However, there are a number of significant changes under the hood:</p>
<p>Major features:<br />
<strong>Caching</strong><br />
By request&#8230; GitPHP now makes use of Smarty caching to cache the output of any action &#8211; this includes all pages, blobs, diffs, searches, and even snapshots.  There are new cache options in the example config, so make sure you copy them into your existing config to turn on caching and choose your desired cache lifetime.<br />
GitPHP will attempt to automatically expire the cache appropriately.  When a page is loaded for a project, it will expire any cached pages that are older than the most recent commit to the project, on any head.  This ensures that users are always seeing the proper information for the project, and not seeing outdated information due to cached pages that have been hanging around too long.  This check is a tiny performance hit, but is trivial compared to the gain of caching.  You <em>can</em> turn this off if you want to skip the check, but you should beware that users could be seeing mixes of old and new data depending on what has and hasn&#8217;t been cached.  You can also turn this off if commits are coming in so quickly that the cache is constantly being expired, but if you&#8217;re doing your git workflow properly (occasionally pushing groups of commits from a private to a public repository) this should not be the case.<br />
If you ever run into cache issues, you can go to</p>
<p>http://yourserver.com/gitphp/index.php?a=expire</p>
<p>to forcefully expire everything in the cache.  You will also need to do this if you change any config options.  This is not linked anywhere from the interface since it&#8217;s an administrative action; you have to type it in yourself.</p>
<p><strong>Unified templates</strong><br />
I realized that the way I was handling templates previously was hampering customizability.  I had template pieces that got displayed in order&#8230; for example, the header template, then the nav template, then the paging prev/next template, then the log template, then the footer template&#8230; you get the idea.  While each of those templates was customizable, I was still enforcing the order of elements &#8211; eg the nav always had to be first, before the content.<br />
Now, each page&#8217;s template is a single file that displays everything.  This allows full flexibility to customize the template any way you want &#8211; anything can now be moved anywhere on the page.  (It also made implementing caching easier)<br />
This is a very slight performance degradation compared to previous versions, because there are times where the code will have to loop twice &#8211; once to parse data, then another time to output it in the template.  However, caching completely eliminates this difference (and then some).</p>
<p>Minor features:</p>
<ul>
<li>Debugging can be turned on with a new config option.  This is probably not useful for most users.  However, this will display the execution time of a given page at the bottom, so it can be useful for checking how much time a particular action on a repository takes &#8211; although naturally, this is influenced by the cache</li>
</ul>
<p>Bugfixes:</p>
<ul>
<li>The &#8220;performance fix&#8221; introduced in version 0.0.6 made use of the &#8211;skip parameter for revision lists.  This parameter was introduced in git 1.5.0, which means that revision browsing was effectively broken for any version of git lower than that.  (It was broken on this site&#8230; dreamhost runs git 1.4.4.4).  I have now made it backwards compatible; gitphp will use the faster &#8211;skip parameter if it detects you are running git 1.5.0 or greater, and transparently fall back to the old method if you are not.  I refuse to be like gitweb and require the gitweb and git versions to both be the most current; I&#8217;ll always support old versions to the best of my ability, so please report bugs on <a href="http://mantis.xiphux.com">Mantis</a> if you have any issues with old versions.</li>
<li>Whitespace is preserved on non-html pages (such as opml and rss) for readability</li>
<li>The blob page now properly displays ref tags for HEAD</li>
<li>Pages now properly report their charset to the browser as UTF-8</li>
<li>Pages do not use the output buffer anymore.  It is unnecessary if you are using caching, and avoids issues where the snapshot is larger than the output buffer and gets truncated</li>
</ul>
<p>Internationalization is not in this release.  Technically it is done, but no one showed interest in translating into another language.  Abstracted and tokenized strings, without any other languages besides English, are just an unnecessary performance hit.  The code still exists in the branch <a href="http://www.xiphux.com/gitphp/index.php?p=php/gitphp.git&#038;a=shortlog&#038;h=refs/heads/i18n-manual">i18n-manual</a>, but I&#8217;m not going to merge the feature until there&#8217;s a reason to, meaning there&#8217;s at least one other language to offer.</p>
<p>As always, the release is on the <a href="http://www.xiphux.com/programming/php/gitphp/">GitPHP</a> page, and bugs can be reported on <a href="http://mantis.xiphux.com">Mantis</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiphux.com/2009/07/25/gitphp-0-0-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GitPHP internationalization</title>
		<link>http://www.xiphux.com/2009/07/05/gitphp-internationalization/</link>
		<comments>http://www.xiphux.com/2009/07/05/gitphp-internationalization/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 01:54:24 +0000</pubDate>
		<dc:creator>xiphux</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gitphp]]></category>

		<guid isPermaLink="false">http://www.xiphux.com/?p=642</guid>
		<description><![CDATA[If you would like to see the next gitphp release in your language, and can translate tokenized strings, I would be interested in hearing from you: xiphux@gmail.com.]]></description>
			<content:encoded><![CDATA[<p>If you would like to see the next gitphp release in your language, and can translate tokenized strings, I would be interested in hearing from you: <a href="mailto:xiphux@gmail.com">xiphux@gmail.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiphux.com/2009/07/05/gitphp-internationalization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GitPHP 0.0.7</title>
		<link>http://www.xiphux.com/2009/07/03/gitphp-0-0-7/</link>
		<comments>http://www.xiphux.com/2009/07/03/gitphp-0-0-7/#comments</comments>
		<pubDate>Sat, 04 Jul 2009 04:11:50 +0000</pubDate>
		<dc:creator>xiphux</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[gitphp]]></category>

		<guid isPermaLink="false">http://www.xiphux.com/?p=637</guid>
		<description><![CDATA[This one is a minor release. No new config options. There are three small(-ish) changes: Readable names in diffs (I changed some of these last release but didn&#8217;t get all of them) Treeview paths now have clickable links for each folder, so you can jump to any parent directory easily Ref icons appear in more [...]]]></description>
			<content:encoded><![CDATA[<p>This one is a minor release.  No new config options.</p>
<p>There are three small(-ish) changes:</p>
<ul>
<li>Readable names in diffs (I changed some of these last release but didn&#8217;t get all of them)</li>
<li>Treeview paths now have clickable links for each folder, so you can jump to any parent directory easily</li>
<li>Ref icons appear in more places by commit titles</li>
</ul>
<p>I wouldn&#8217;t normally do a release this small, but I&#8217;m planning on making some major changes to the way templates work (internally, not really much difference visible to users), which is a change that could potentially take a while, so I wanted to get these fixes out and released before I started anything.</p>
<p>As always, packages are available from the <a href="http://www.xiphux.com/programming/php/gitphp/">GitPHP</a> page, and bugs can be reported by <a href="http://mantis.xiphux.com">Mantis</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiphux.com/2009/07/03/gitphp-0-0-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
