I’ve been going through and doing some cleanup on my old php projects. Some of them had some pretty crappy coding practices, since they were written back when I was still learning PHP and SQL. For example, they had all functions lumped together in one function library – made it easier to write, but it meant that every single operation loaded all the code for every single function into php’s memory. Why load 10 functions into memory when you’re only using one of them? Also, SQL functions were mainly used for fetching records, and most of the sorting/association was done by PHP. I did it at the time because I knew PHP a lot better than I did SQL, and it meant I could avoid some of the more complicated SQL stuff such as JOINs and subqueries. However in practice it’s better to have as much of that done by the SQL server as possible, since it’s much faster and more efficient than PHP at managing data. So I managed to do major cleanup of all three of my PHP projects. Unfortunately I didn’t really get around to adding new features, which is why the three projects were only bumped minor versions, and not major versions.
The changelogs are as follows:
Codex:
- Move config to its own directory
- Smarty and ADOdb prefixes are now configurable
- Break up function library into a file for each function that’s loaded on demand
- Remove usage of obsolete HTTP_GET_VARS and HTTP_POST_VARS
- Rewrite matchup_data to use SQL and be more efficient
- SQL file is now included in tarball
- Use a more sane versioning scheme (e.g. 0.3.3 instead of v03c)
Codex actually still has some speed issues – part of it is due to some more shitty code that needs to get cleaned up, part of it is due to the sheer amount of data it fetches and cross-references at any given time.
MDB:
- Prevent SQL injections in searches
- Move config to its own directory
- Break up function library into a file for each function that’s loaded on demand
- Made ADOdb prefix configurable
- Rewrite SQL/PHP in functions unmapped, taglist, prunetags, userhistory, titlelist
- Fixed file download function which broke in some browsers
- Use a transaction during database update to avoid users seeing corrupt data during update
- Move config to its own dir
- Break up function library into a file for each function that’s loaded on demand
- Use a more sane versioning scheme (e.g. 0.0.4 instead of v01d)
- Fix broken snapshot URL on some pages
- Fix missing header that broke formatting on tag page
- Fix duplicated “…” that appeared on truncated shortlogs
- Fix sorting functions on main project list page
- Project lists searching a directory (rather than using a predefined list in the config) now search recursively
- Add “TXT” plaintext project list link on front page
- Fix ref icons next to commits with tags/heads
- Some adjustments to links on pages to match more closely with current gitweb
- Links to files on commitdiff pages now work
- Diff binary path is now configurable
- Now works on Windows with msysgit! Thanks to testing and bugfixes from Slash
Slash was a big help with much of the Windows testing/bugfixes on this release, as I don’t have any windows boxes. GitPHP can now work drop-in on Windows as long as you read the config and set the paths to your binaries correctly.
Tarballs of all new releases are available on their respective project pages. Since the directory structure of these releases have changed significantly, I recommend deleting files from the previous version before extracting this version.
I have also added a bugtracker on this site for people to report bugs with the software, at http://mantis.xiphux.com. Given how many people actually use anything I write (countable on one hand), I don’t forsee it being used much, but at least it’s there if I or anyone else ever needs it.