Just over a week after the last update, here is MDB 0.0.6. MDB had the most potential for features to be added, so that’s what I focused on. Here is the rather large changelog:
- Database update times are logged in a table
- The updatedb page shows the output of the status test if something goes wrong
- PHP commandline binary used in db updates is configurable
- Allow setting a cooloff time between database updates (for example, if last update was less than X seconds ago, skip update)
- Fixed the shell hack mutex test in some places
- Allow using the database to store update status (rather than just testing with ps and grep) – please read the notes in the config file before enabling this!
- Add debug option to dump a bunch of info during execution
- Fix OPTIMIZE TABLE calls that weren’t working
- The optimize configure option now applies to updatedb (so optimizing after updating can be optional too)
- Updatedb status test reports when cooloff time hasn’t been met
- Mapping sanity check has been moved to a more generic db check page that will also check consistency of dbmutex
- Optimizing is done on dbcheck page instead of during db stats
- Use php’s builtin uname for dbstats page instead of running external uname
- Clean up uptime output on dbstats page
- Avoid caching password hash in session key
- Add user management page so admins can add and delete users, and change user privileges (from/to admin)
- Add preferences page for users to change passwords
- Metadata links for titles have been moved to a generic links table, rather than an AnimeNFO-specific table
- Title list no longer depends on images that I couldn’t include – colored by CSS now
- Use newer mootools rather than old moo.fx for javascript effects (scripts included now)
- CSS split into themes – formatting is in a core css file and colors/styles are in separate theme files. Comes with three themes – Dark Aqua, Dark Lime, and Light
- Users can set their preferred css theme on their preferences page
- Some PHP warnings are cleaned up
- Chooses an optimal title listing method (SQL queries or iteration) by the number of titles in the system
- Title listing using SQL uses prepared statements for speedup
- A footer now shows db status (size, titles, files, etc), the number of queries executed, and the execution time of the page
- Footer and main page show a warning when database is upgrading
- ADOdb caching now works (it didn’t before) – please read the notes in the config file about adodb caching’s performance hit before enabling!
- Remove limit statements to be more portable with other databases
- Remove file_title association table and embed the title id in the file database instead – files can only have one title
- Fix bug with tag substring collisions (e.g. “girls” and “girls with guns” being treated as the same tag)
- Change delete links to submit buttons that use POST – safer to avoid accidental triggering by spiders (although I don’t know why you’d spider this in the first place)
- Database operations (updatedb, dbstats, dbcheck) are now all triggered from one admin-only database page
- Minor optimizations of SQL queries
- Only count directories as titles
- Filelist on title page is now shown hierarchically indented by directory
- Directories on title page are now collapsible by javascript. All files are shown by default, so will degrade gracefully if javascript is off – directories just won’t collapse
This version has significant architectural differences from the previous versions. Everything is included now so you may want to get rid of your own copies of moo.fx and titlelist images. The database is also structurally different. I unfortunately have not written a database upgrade script. In general though, the following changes are required:
- Add the dbupdate table
- Add the preferences table
- Remove the file_title table and add the new field to the files table. If you know how to do this yourself by phpmyadmin or the like then the description of the field is in the SQL file. If not, then delete the table and recreate it using the one in the SQL file. Either way, run updatedb to restore consistency to the database.
- Delete the animenfo table and create the links table. Unfortunately there isn’t really an easy way to migrate the data from one table to another. If you really have a lot of data in the animenfo table you want migrated, I can help you write the SQL to do so.
All other tables have remained the same, so you can keep your same users and stuff. But since some tables have changed and some tables haven’t, it may be easiest to just drop all tables in the database, import the SQL fresh, and update your db. I apologize for any inconvenience.
If you have no users and have trouble figuring out how the users table works (I know I forgot to include a default user before), I have included an SQL file that creates an admin user with username/password root/root. From there you can add more users and delete the root user if you’d like. Of course, make sure you have at least 1 admin!
The tarball is on the MDB page.