Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
479bd2fe
Commit
479bd2fe
authored
18 years ago
by
Neil Drumm
Browse files
Options
Downloads
Patches
Plain Diff
#73615
by chx, Eaton, and Steven, Provide the full range of Drupal functions to .install files
parent
7645a1f4
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
includes/common.inc
+6
-1
6 additions, 1 deletion
includes/common.inc
includes/install.inc
+48
-13
48 additions, 13 deletions
includes/install.inc
with
54 additions
and
14 deletions
includes/common.inc
+
6
−
1
View file @
479bd2fe
...
@@ -491,11 +491,16 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
...
@@ -491,11 +491,16 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
* 1 = Log errors to database and to screen.
* 1 = Log errors to database and to screen.
*/
*/
function
error_handler
(
$errno
,
$message
,
$filename
,
$line
)
{
function
error_handler
(
$errno
,
$message
,
$filename
,
$line
)
{
// If the @ error suppression operator was used, error_reporting is temporarily set to 0
if
(
error_reporting
()
==
0
)
{
return
;
}
if
(
$errno
&
(
E_ALL
^
E_NOTICE
))
{
if
(
$errno
&
(
E_ALL
^
E_NOTICE
))
{
$types
=
array
(
1
=>
'error'
,
2
=>
'warning'
,
4
=>
'parse error'
,
8
=>
'notice'
,
16
=>
'core error'
,
32
=>
'core warning'
,
64
=>
'compile error'
,
128
=>
'compile warning'
,
256
=>
'user error'
,
512
=>
'user warning'
,
1024
=>
'user notice'
,
2048
=>
'strict warning'
);
$types
=
array
(
1
=>
'error'
,
2
=>
'warning'
,
4
=>
'parse error'
,
8
=>
'notice'
,
16
=>
'core error'
,
32
=>
'core warning'
,
64
=>
'compile error'
,
128
=>
'compile warning'
,
256
=>
'user error'
,
512
=>
'user warning'
,
1024
=>
'user notice'
,
2048
=>
'strict warning'
);
$entry
=
$types
[
$errno
]
.
': '
.
$message
.
' in '
.
$filename
.
' on line '
.
$line
.
'.'
;
$entry
=
$types
[
$errno
]
.
': '
.
$message
.
' in '
.
$filename
.
' on line '
.
$line
.
'.'
;
//
Note: f
orce display of error messages in update.php
//
F
orce display of error messages in update.php
if
(
variable_get
(
'error_level'
,
1
)
==
1
||
strstr
(
$_SERVER
[
'PHP_SELF'
],
'update.php'
))
{
if
(
variable_get
(
'error_level'
,
1
)
==
1
||
strstr
(
$_SERVER
[
'PHP_SELF'
],
'update.php'
))
{
drupal_set_message
(
$entry
,
'error'
);
drupal_set_message
(
$entry
,
'error'
);
}
}
...
...
This diff is collapsed.
Click to expand it.
includes/install.inc
+
48
−
13
View file @
479bd2fe
...
@@ -270,11 +270,50 @@ function drupal_install_profile($profile) {
...
@@ -270,11 +270,50 @@ function drupal_install_profile($profile) {
require_once
(
$profile_file
);
require_once
(
$profile_file
);
// Get a list of modules absolutely required by Drupal.
$bootstrap_list
=
array
(
'system'
);
// Get a list of modules required by this profile.
// Get a list of modules required by this profile.
$function
=
$profile
.
'_profile_modules'
;
$function
=
$profile
.
'_profile_modules'
;
$module_list
=
$function
();
$module_list
=
$function
();
// If anyone has added modules that we automatically install, filter them out.
$module_list
=
array_diff
(
$module_list
,
$bootstrap_list
);
// Verify that all required modules exist.
// Verify that all required modules exist.
$bootstrap_modules
=
drupal_find_modules
(
$bootstrap_list
);
$profile_modules
=
drupal_find_modules
(
$module_list
);
// Install the essential system modules and bootstrap Drupal.
drupal_install_modules
(
$bootstrap_list
);
drupal_bootstrap
(
DRUPAL_BOOTSTRAP_FULL
);
// Install schemas for profile and all its modules.
$function
=
$profile
.
'_install'
;
if
(
function_exists
(
$function
))
{
$function
();
}
drupal_install_modules
(
$module_list
);
// Enable the modules required by the profile.
db_query
(
"DELETE FROM
{
system
}
WHERE type = 'module'"
);
$modules
=
array_merge
(
$bootstrap_modules
,
$profile_modules
);
foreach
(
$modules
as
$module
)
{
db_query
(
"INSERT INTO
{
system
}
(filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES('%s', '%s', 'module', '', 1, 0, 0, 0)"
,
$module
->
filename
,
$module
->
name
);
}
}
/**
* Finds the file paths for a set of modules.
*
* @param module_list
* The modules to locate.
* @return
* An array containing file information for the modules.
*/
function
drupal_find_modules
(
$module_list
=
array
())
{
$modules
=
array
();
$modules
=
array
();
foreach
(
$module_list
as
$current
)
{
foreach
(
$module_list
as
$current
)
{
$module
=
file_scan_directory
(
'./modules'
,
"^
$current
.module$"
,
array
(
'.'
,
'..'
,
'CVS'
),
0
,
TRUE
,
'name'
,
0
);
$module
=
file_scan_directory
(
'./modules'
,
"^
$current
.module$"
,
array
(
'.'
,
'..'
,
'CVS'
),
0
,
TRUE
,
'name'
,
0
);
...
@@ -285,26 +324,22 @@ function drupal_install_profile($profile) {
...
@@ -285,26 +324,22 @@ function drupal_install_profile($profile) {
$modules
=
array_merge
(
$modules
,
$module
);
$modules
=
array_merge
(
$modules
,
$module
);
}
}
}
}
return
$modules
;
}
/**
* Execute the install scripts for a set of modules.
*
* @param module_list
* The modules to install.
*/
function
drupal_install_modules
(
$module_list
=
array
())
{
// Get a list of all .install files.
// Get a list of all .install files.
$installs
=
drupal_get_install_files
(
$module_list
);
$installs
=
drupal_get_install_files
(
$module_list
);
// Install schemas for profile and all its modules.
$function
=
$profile
.
'_install'
;
if
(
function_exists
(
$function
))
{
$function
();
}
foreach
(
$installs
as
$install
)
{
foreach
(
$installs
as
$install
)
{
require_once
$install
->
filename
;
require_once
$install
->
filename
;
module_invoke
(
$install
->
name
,
'install'
);
module_invoke
(
$install
->
name
,
'install'
);
}
}
// Enable the modules required by the profile.
db_query
(
"DELETE FROM
{
system
}
WHERE type = 'module'"
);
foreach
(
$modules
as
$module
)
{
db_query
(
"INSERT INTO
{
system
}
(filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES('%s', '%s', 'module', '', 1, 0, 0, 0)"
,
$module
->
filename
,
$module
->
name
);
}
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment