logo       

[task] Drupal Install System: msg#00520

php.drupal.devel

Subject: [task] Drupal Install System

Project: Drupal
Version: cvs
Component: base system
Category: tasks
Priority: normal
Assigned to: adrian
Reported by: adrian
Updated by: weitzman@xxxxxxxxxxxx
Status: patch

I played around with the patch, and successfully installed a new Drupal
instance on the fitst try. Nice work, Adrian! I reviewed the code too,
and found it quite Drupalish and satsfactory.

Here are some notes from my install:
- On the configuration file page, I selected from the radio button
options a file which was not conf.php and thus did not exist. I
strugged with the 'file is not writeable' error for a while until I
realized that you expected me to create the file and then the installer
would edit it ... in general, this page is a pretty complex
introduction into drupal. I suggest simply assuming 'conf.php' here. I
haven't thought about this much though.

- Similar to above, I figured Drupal would create a database for me.
Not so, I had to create it and then Drupal takes over. Some simple help
text adddresses this point.

- Use form_password() or similar when requesting a database password

- The default $base_url was missing a slall for me. It said
'http://medrinstall' instead of 'http://me/drinstall'

- After completing the DB install, there is no page telling you what to
do next. A link to the home page is all thats needed IMO.

-The site_name chosen during the install was not saved in the
'variable' table.

- When you return to install.php some time later, you have no
indication what a working site already exists. Not sure thats the right
thing to do. Not a big deal though.


P.S. Adrians suggestion to store the .install files in module specific
subdirs under modules makes sense to me. Thus system.install would move
to modules/system/system.install

weitzman@xxxxxxxxxxxx



Previous comments:
------------------------------------------------------------------------

January 29, 2004 - 04:10 : adrian

I am in the process of developing a new Install API for the drupal core,
which will allow a completely web based install / set up process, as well as allow
contributed modules to integrate more directly into this system.

A more detailed description of the system is available in this thread.

This task has been created to place each of the successive patches in
the patch queue.
------------------------------------------------------------------------

January 29, 2004 - 04:20 : adrian

Attachment: http://drupal.org/files/issues/install_api_first_level.patch (6.42
KB)

Kjartan correctly identified one of the problems in creating a unified install system.

There's a lot of code that gets run by simply including the core files
(bootstrap.inc, database.inc, session.inc and common.inc).
A lot of this code relies upon the database connection going off
without a hitch, like for instance the current system variables, themes
and session code. To work around this i created a new drupal_init()
function, which needs to be called when you want the system to
initialize.
drupal_init has a 'db_init' argument, which allows you to bypass the
loading of all the database related code with a simple flag.
install.php needs to run drupal core, while ignoring any database
connections .. until atleast the point where the configuration settings
for the database are entered, and confirmed to work.

There is a new function created called 'database_connected()' , which
returns a boolean true only if the database both connected and the
table was selected successfully. This patch does not have a suitable
error message for index.php upon not being able to make a database
connection ,but that message should very likely be discussed and
finalized.

In the next level of the patch I will introduce the major changes, or
rather additions. I haven't modified any existing files beyond the ones
in this patch (at this time).



------------------------------------------------------------------------

January 29, 2004 - 07:24 : Kjartan

This patch has some serious flaws though. [?php
include_once "includes/bootstrap.inc";
-drupal_page_header();
include_once "includes/common.inc";
?]
By removing the drupal_page_header() you break the whole point of
bootstrap as the common.inc stuff is included when its not necessary.
It needs some more thought. Maybe you should take the time to make a
workflow of the current Drupal init process before modifying it.

Also the naming of constants, I would prefer calling them
DATABASE_ATTEMPT as it makes it easier to tell them appart.

------------------------------------------------------------------------

February 9, 2004 - 15:18 : adrian

I have reworked the patch into a very minimal set of requirements.

To prevent the .inc files from running any code when you don't want
them to , you 'define' a
constant called 'DRUPAL_NO_INIT' before including bootstrap.inc.


This relatively small patch is required for the install stuff to work.

------------------------------------------------------------------------

February 9, 2004 - 15:22 : adrian

Attachment: http://drupal.org/files/issues/drupal_no_init_flag.patch (3.88 KB)

i'll even attach it this time.

------------------------------------------------------------------------

February 9, 2004 - 15:48 : adrian

Attachment: http://drupal.org/files/issues/database_init_return.patch (1.96 KB)

The following patch is a modification to the includes/database*.inc set
of files,
to make db_connect return a boolean value depending on wether the
connection was
successfully made.
I have changed database.inc to die() upon connection error with the
message "Database Connection Unsuccessful".
Cleaning up that message and placing a help page might be a good idea
from an user experience point of view.

This patch is required for the install system, in that it needs to test
wether it has made a successfull database
connection before it allows you to actually install the schema.


------------------------------------------------------------------------

February 9, 2004 - 20:15 : adrian

Attachment: http://drupal.org/files/issues/install_system_alpha.tar.bz2 (11.59
KB)

This is an alpha version of the new install API code. It is completely
capable of installing the drupal core system
without requiring any interaction with the database side. There are
currently 5 configuration screens ,
but the API is sound for us to add / remove / change these screens as
we need.

In it's current state, it isn't capable of updating the base system,
however the backend stubs exist, and have been tested.

In the push to get the install process running smoothly i simply
disabled the update interface.
The previous 2 patches on this node need to be applied, but have been
combined into install_system_alpha.patch which is included
in this distribution.

The rest of the files are new , and should not interfere with the
drupal core at all.

They are

includes/install.inc ... the file that hosts the install api.
install.php ... the front end script that initializes the install api (a total of
5 lines)
install/system.install
... the install module for the core. It contains the bulk of code from
update.php, and all the configuration information needed to successfully
install the core.

In the future , the install api will be able to easily install any
contrib module through
the modulename.install file that will hopefully become well supported.


Note: I need to update the postgres compatibility in this .install
file, and as such only mysql
is fully tested now.

I have posted some screenshots at my site


------------------------------------------------------------------------

February 10, 2004 - 13:22 : adrian

Unconed just pointed out there is a conflict with windows installations
in that there can not be an 'INSTALL' file and an 'install' directory (which
contains the system.install currently)

He suggested that we rename the README and INSTALL files to README.txt
and INSTALL.txt.

I personally move that we store the .install files within the modules
directory , as in the future
installing a contributed module should be as simple as dropping the
module directory (containing .install , .module and whichever external
files)
into modules/ , and then installing the module within drupal.




--
View: http://drupal.org/node/view/5496
Edit: http://drupal.org/project/comments/add/5496





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise