Willr, I understand that _ss_environment.php shares db connections and admin accounts etc across sites, but am I correct in assuming that a separate db is still required for each site?
Unless you use Subsites you will need 1 db for each site. Subsites stores everyone in 1 database with an extra foreign key to the site that record belongs too.
From there I'd love to be able to pass parameters to the install script by running something like:
> php $PROJECT/install.php databasename
and having SS generate the required db tables etc
Don't even bother using the installer, all that does is check requirements and get your info. If you have that information you could have a template _config.php and a .htaccess file, store these in say /sites/template/ and just adapt your script to copy those files into the new project. To build the database you can do that via the command line using sake.
For example this is one of our old internal scripts (still uses svn)
echo `svn cp svn://svn.silverstripe.com/silverstripe/projects/_skel svn://svn.silverstripe.com/silverstripe/projects/$project -m "Created new project '$project'"`;
`svn cp svn://svn.silverstripe.com/silverstripe/open/themes/blackcandy/trunk/blackcandy svn://svn.silverstripe.com/silverstripe/projects/$project/trunk/themes/$project -m "Creating default theme for project '$project'"`;
echo `cd /sites/test.silverstripe.com; svn checkout svn://svn.silverstripe.com/silverstripe/projects/$project/trunk $project`;
echo "\nCustomizing '$project'\n";
templateFile("$project/mysite/_config.php", "%%PROJECT%%", $project);
echo "\nBuilding database\n";
echo `cd /sites/test/www/$project; sake dev/build`;
`chmod 777 -R /tmp/silverstripe-cache-sites-test-www-$project`;
templateFile() is a function which copies an _config.php file to that location and str_replaces the %%PROJECT%% database string and theme name.
You can also not include the $database value and just include the following line in your _ss_environment.php file
Then it will use the sites folder name as the database name and you won't even need to customize the _config.php