Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
bc9aeff7
Commit
bc9aeff7
authored
Dec 29, 2004
by
Dries
Browse files
- Patch
#14890
: corrected the documentation of conf_init().
parent
09c55017
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/bootstrap.inc
View file @
bc9aeff7
...
...
@@ -14,15 +14,27 @@
*
* Try finding a matching configuration directory by stripping the
* website's hostname from left to right and pathname from right to
* left.
If no
configuration file
is
found
, return a default valu
e
*
'$confdir/default'. Example for a ficticious site installed at
*
http://www.drupal.org/test:
* left.
The first
configuration file found
will be used, th
e
*
remaining will ignored. If no configuration file is found,
*
return a default value '$confdir/default'.
*
* 1. www.drupal.org.test
* 2. drupal.org.test
* 3. www.drupal.org
* 4. drupal.org
* 5. default
* Example for a ficticious site installed at
* http://www.drupal.org/mysite/test/ the 'settings.php' is
* searched in the following directories:
*
* 1. $confdir/www.drupal.org.mysite.test
* 2. $confdir/drupal.org.mysite.test
* 3. $confdir/org.mysite.test
*
* 4. $confdir/www.drupal.org.mysite
* 5. $confdir/drupal.org.mysite
* 6. $confdir/org.mysite
*
* 7. $confdir/www.drupal.org
* 8. $confdir/drupal.org
* 9. $confdir/org
*
* 10. $confdir/default
*/
function
conf_init
()
{
static
$conf
=
''
;
...
...
@@ -31,9 +43,9 @@ function conf_init() {
return
$conf
;
}
$confdir
=
'sites'
;
$uri
=
explode
(
'/'
,
$_SERVER
[
'PHP_SELF'
]);
$server
=
explode
(
'.'
,
$_SERVER
[
'HTTP_HOST'
]);
$confdir
=
'sites'
;
for
(
$i
=
count
(
$uri
)
-
1
;
$i
>
0
;
$i
--
)
{
for
(
$j
=
count
(
$server
);
$j
>
0
;
$j
--
)
{
$dir
=
implode
(
'.'
,
array_slice
(
$server
,
-
$j
))
.
implode
(
'.'
,
array_slice
(
$uri
,
0
,
$i
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment