Commit Graph

5 Commits

Author SHA1 Message Date
Cathy J. Fitzpatrick
7d14f125ca Only use first 8 characters of MD5 hash in version 2013-01-26 13:56:41 -07:00
Cathy J. Fitzpatrick
d91e07dad1 Revise version query system
In order to avoid having a dirty working directory on the
live web server, this commit moves index.php to index.php.template.txt
and generates index.php in update-version-query-strings. The index.php
file is not under version control.
2013-01-26 13:46:46 -07:00
Cathy J. Fitzpatrick
3fe5805296 Fix indentation
This is really trivial, but it might as well be fixed.
2013-01-26 00:48:54 -07:00
Cathy J. Fitzpatrick
56cc3f0de4 Change version script for PHP 5.2
The live web server runs PHP 5.2, which apparently does not
support anonymous functions, so the anonymous funciton has
been removed from update-version-query-strings.
2013-01-26 00:25:01 -07:00
Cathy J. Fitzpatrick
7dbb3330c2 New system to automatically update version strings
The index.php file specifies a version query string for each
resource which is likely to change. For example:

    <script src="/js/sim.js?v0.8.2c"></script>

Each time the file is changed, we have incremented the version
number so that browsers and/or the CDN know to download the
file from the web site, rather than using a cached version.
This works because changing the version query string changes
the file name of the resource.

This commit introduces a new program (update-version-query-strings)
which parses index.php and sets each version query string to be
the MD5 hash of the corresponding resource. On the live web
server, this program is set to run for the following git hooks:

    post-commit, post-checkout, post-merge, post-rewrite

This new system removes the need to manually update version query
strings. Instead, the version query strings will be automatically
updated when we update the live web site from now on.
2013-01-25 23:36:33 -07:00