[drupal-devel] [task] Drupal Install System
Adrian Rossouw
adrian at daemon.co.za
Thu Mar 31 22:06:43 UTC 2005
On 31 Mar 2005, at 11:20 PM, Daniel Convissor wrote:
> Hi Adiran:
>
> On Thu, Mar 31, 2005 at 09:43:06PM +0200, Adrian Rossouw wrote:
>>
>> The idea would be to create a drupal.install file, which would use the
>> drupal db_query function
>> on the schema elements.
>
> What's a "drupal.install file," please?
>
> Here's my goal at this point for the script I'm creating: once users
> have
> set up their /drupal/sites/*/settings.php files, they can execute my
> script by going into the database directory and issuing the following
> command: "php ./create.php". That would create all of their tables in
> one
> shot.
I understand, and i think it's a worthy goal, and useful for inclusion.
Basically I am writing a dpkg-like system for Drupal (although nowhere
near as complex), which adds a few extra hooks to allow users to install
and update their sites without needing to have any form of shell access.
(Actually, in all likelihood, it should be possible to write a
drupal2deb
script that builds .debs for all the modules and themes in each
release.)
This includes installing contrib modules, and core .. and also updating
core and modules in contrib.
A 'install file' is a php file that contains the schema and the updates
within
Drupal hooks. The _install() hook for a schema file would look like :
function modulename_install() {
db_query("CREATE TABLE {modulename} ( ... ");
}
The db_query() function call is what Drupal uses internally to apply
the db_prefix for all the database queries against a running db.
Also, unlike your functions, it operates only within the one site, and
it
uses (and indeed is an extension) of the Drupal api. Also, the system
I am working on would be able to be scripted to install and update
any sites / modules it finds, and indeed it (almost) works that way
on Bryght at the moment. We just don't install core using it, as a lot
of work still needs to happen before it's feasible.
--
Adrian Rossouw
Drupal developer and Bryght Guy
http://drupal.org | http://bryght.com
More information about the drupal-devel
mailing list