[eluser]ntheorist[/eluser]
one quick idea to automate the regeneration of the production cache files would be to run filemtime() on the model class file itself and compare it to the cache file's fliemtime. If it's older than the model file, regenerate it.
you could pass the $file var in the autoload functions to Datamapper just before require_once, so when the model loads it already has its file location available. Then just add to line 131
Code:
// If you edit and save the model file, it will be newer than the cache file and force regeneration
if(file_exists($cache_file) && (filemtime($cache_file) < filemtime($classpath)) )
this way the production cache will constantly keep up with model edits and help to prevent data corruption as warned in the docs.