[drupal-devel] Drupal executes stuff in .inc files
Hi there! One of the problems that our Debian packager has had is that for example the update script includes bootstrap.inc and common.inc. These in turn include severayl other .inc files. In three of these files (bootstrap, common, and session) there is php code that does not only define new functions, but also executes them. This is pretty annoying, as it for example starts a session which you might not want and initializes several parts of Drupal you might prefer to not execute for some reason. You'd however still like all the common.inc functions to be available. This will be neccessary to create a php solution for downloading protected files without executing all of Drupal again. In the attached patch, I've moved all the functions that should be executed into index.php. This is again not ideal, as for example my generate scripts will need to copy quite some code from index.php with this patch. Ideally we'd have a bootstrap-exec.php and a common-exec.php file that would hold all this function calls, leaving only the session functions in index.php. I believe that this approach might be helpfull for Adrian's installer as well. Comments? Cheers, Gerhard
Gerhard Killesreiter wrote:
Hi there!
One of the problems that our Debian packager has had is that for example the update script includes bootstrap.inc and common.inc. These in turn include severayl other .inc files. In three of these files (bootstrap, common, and session) there is php code that does not only define new functions, but also executes them. This is pretty annoying, as it for example starts a session which you might not want and initializes several parts of Drupal you might prefer to not execute for some reason. You'd however still like all the common.inc functions to be available.
Very good -your patch-, not only for the reasons you point out, but also for cleanness and readability of the code.
participants (3)
-
Gerhard Killesreiter -
Jose A. Reyero -
Negyesi Karoly