Closed (duplicate)
Project:
Drupal core
Version:
6.x-dev
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
13 Dec 2006 at 12:59 UTC
Updated:
10 May 2007 at 21:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
heine commentedComment #2
ChrisKennedy commentedSyncing with HEAD.
Comment #3
ChrisKennedy commentedI noticed two coding style errors in string concatenation.
Comment #4
Anonymous (not verified) commentednice. tested and good. +1
something so simple yet again.. damn i need start thinking of these simple things :P
Comment #5
Anonymous (not verified) commentedlook at the code..
should move the global killswitch to a js file.
Comment #6
ChrisKennedy commentedActually the .js file shouldn't even have been included in the patch, as it's actually part of #97213 (which this issue is dependent on). The killswitch can't be moved into the .js file as it's shared among multiple pages. Also, the patch from #3 was the wrong file.
I'll reroll the patch based on #1 once http://drupal.org/node/97213 or something similar is committed.
Comment #7
ChrisKennedy commentedRe-rolled with some minor updates.
Comment #8
ChrisKennedy commentedSorry, a few more minor updates.
Comment #9
webchick+1 for this functionality.
I'm confused though... why all those checks? Why not have the auto-set thing happen in system_install() or something, so that it only runs once?
Comment #10
ChrisKennedy commentedBased on my understanding of Drupal, which could very well be in error, the checks will always need to be in there if we use the current testing technique (Ajax request to a Drupal callback). I'm not sure I follow your alternative suggestions - perhaps you can elaborate?
My understanding is as follows: we need to use some method (javascript currently, but we could theoretically use php/curl instead) to request a standard callback within Drupal, accessed via clean URLs. If it succeeds the callback will be executed and should enable clean URLs, and if it fails the callback will never be triggered (obviously). But AFAIK there isn't a clean way to remove the defined callback post-installation or after the check has succeeded.
But I'm certainly no expert at Drupal internals so I might just be overlooking something obvious.
Comment #11
ChrisKennedy commentedWell, I should add that within the current suggested implementation, rather than doing those checks we also have the option of setting a variable to indicate that installation was completed, and check within the clean URLs install callback that this variable hasn't been set yet.
I considered this possibility back when I initially looked at the functionality, but I didn't see a simple way for the Ajax to be run automatically, after installation was successful, but before a php variable was set indicating that installation was completed. It's very possible that I didn't give this sufficient consideration.
Now that I think about it maybe we could set the variable with the installation timestamp, and then within the callback check that it is within ~5 minutes of the installation time. And it might be a handy variable to define for general system administration purposes (e.g. by putting it in the status report).
Comment #12
webchickI'm not up on AJAX, so you'll need to excuse my ignorance. :)
But it's this just a matter of attempting to grab the contents at something like www.example.com/node and making sure it doesn't return a 404? If so, you could do it with straight PHP (drupal_http_request). And it would work for people without JS too.
Comment #13
chx commentedneh. drupal_http_request was used before and it's a quagmire of problems
Comment #14
dries commentedThe checks are weird indeed. (I'm in a hurry right now -- I'll follow up with more thoughts.)
Comment #15
ChrisKennedy commentedAny more thoughts on this? I'm ready to improve it if I can get some more concrete suggestions.
Comment #16
dries commentedI think we'll want to eliminate some of these checks. There should be a clean way to check whether we're currently installing Drupal (or whether someone is trying to do unwanted things). The cleanest solution might be to use a tri-state variable. It would have the following states:
Then all you need to do is:
Also, let's not create a dedicated watchdog category for clean URL tests. Ideally, this should be 100% transparent for the user, so I'd advocate removing the watchdog() calls and failing silently.
Can you give that a try Chris?
Comment #17
ChrisKennedy commentedAdded clean URLs to http://drupal.org/node/141637 so this isn't needed anymore.