mirror of
https://github.com/tag1consulting/d7_to_d10_migration.git
synced 2025-09-06 09:01:23 +00:00
Update Drupal 7 dependencies
This commit is contained in:
parent
7d902ba1ef
commit
13df912654
391 changed files with 2900 additions and 1502 deletions
|
@ -2967,7 +2967,11 @@ function drupal_set_time_limit($time_limit) {
|
|||
* The path to the requested item or an empty string if the item is not found.
|
||||
*/
|
||||
function drupal_get_path($type, $name) {
|
||||
return dirname(drupal_get_filename($type, $name));
|
||||
if ($filename = drupal_get_filename($type, $name)) {
|
||||
return dirname($filename);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -5544,8 +5548,27 @@ function drupal_cron_run() {
|
|||
DrupalQueue::get($queue_name)->createQueue();
|
||||
}
|
||||
|
||||
$module_previous = '';
|
||||
|
||||
// If detailed logging isn't enabled, don't log individual execution times.
|
||||
$time_logging_enabled = variable_get('cron_detailed_logging', DRUPAL_CRON_DETAILED_LOGGING);
|
||||
|
||||
// Iterate through the modules calling their cron handlers (if any):
|
||||
foreach (module_implements('cron') as $module) {
|
||||
if ($time_logging_enabled) {
|
||||
if (!$module_previous) {
|
||||
watchdog('cron', 'Starting execution of @module_cron().', array('@module' => $module));
|
||||
}
|
||||
else {
|
||||
watchdog('cron', 'Starting execution of @module_cron(), execution of @module_previous_cron() took @time.', array(
|
||||
'@module' => $module,
|
||||
'@module_previous' => $module_previous,
|
||||
'@time' => timer_read('cron_' . $module_previous) . 'ms',
|
||||
));
|
||||
}
|
||||
timer_start('cron_' . $module);
|
||||
}
|
||||
|
||||
// Do not let an exception thrown by one module disturb another.
|
||||
try {
|
||||
module_invoke($module, 'cron');
|
||||
|
@ -5553,6 +5576,20 @@ function drupal_cron_run() {
|
|||
catch (Exception $e) {
|
||||
watchdog_exception('cron', $e);
|
||||
}
|
||||
|
||||
if ($time_logging_enabled) {
|
||||
timer_stop('cron_' . $module);
|
||||
$module_previous = $module;
|
||||
}
|
||||
}
|
||||
|
||||
if ($time_logging_enabled) {
|
||||
if ($module_previous) {
|
||||
watchdog('cron', 'Execution of @module_previous_cron() took @time.', array(
|
||||
'@module_previous' => $module_previous,
|
||||
'@time' => timer_read('cron_' . $module_previous) . 'ms',
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// Record cron time.
|
||||
|
@ -8212,7 +8249,10 @@ function entity_get_controller($entity_type) {
|
|||
$controllers = &drupal_static(__FUNCTION__, array());
|
||||
if (!isset($controllers[$entity_type])) {
|
||||
$type_info = entity_get_info($entity_type);
|
||||
$class = $type_info['controller class'];
|
||||
// Explicitly fail for malformed entities missing a valid controller class.
|
||||
if (!isset($type_info['controller class']) || !class_exists($class = $type_info['controller class'])) {
|
||||
throw new EntityMalformedException(t('Missing or non-existent controller class on entity of type @entity_type.', array('@entity_type' => $entity_type)));
|
||||
}
|
||||
$controllers[$entity_type] = new $class($entity_type);
|
||||
}
|
||||
return $controllers[$entity_type];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue