From f3a72313564525ebac876153ce1c8ffb6f4948b6 Mon Sep 17 00:00:00 2001 From: webchick Date: Fri, 24 Jan 2014 18:07:30 -0800 Subject: [PATCH] Issue #2173335 by sun: Remove deprecated timer_* functions. --- core/includes/batch.inc | 5 ++-- core/includes/bootstrap.inc | 24 ------------------- .../views_ui/lib/Drupal/views_ui/ViewUI.php | 5 ++-- core/scripts/run-tests.sh | 5 ++-- 4 files changed, 9 insertions(+), 30 deletions(-) diff --git a/core/includes/batch.inc b/core/includes/batch.inc index 597ab43a74b..45f2216219f 100644 --- a/core/includes/batch.inc +++ b/core/includes/batch.inc @@ -14,6 +14,7 @@ * @see batch_get() */ +use Drupal\Component\Utility\Timer; use Drupal\Core\Batch\Percentage; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -214,7 +215,7 @@ function _batch_process() { // proceed with the same batch phase when a processing time of 1 second has // been exceeded. if ($batch['progressive']) { - timer_start('batch_processing'); + Timer::start('batch_processing'); } if (empty($current_set['start'])) { @@ -277,7 +278,7 @@ function _batch_process() { $queue = _batch_queue($current_set); // If we are in progressive mode, break processing after 1 second. - if ($batch['progressive'] && timer_read('batch_processing') > 1000) { + if ($batch['progressive'] && Timer::read('batch_processing') > 1000) { // Record elapsed wall clock time. $current_set['elapsed'] = round((microtime(TRUE) - $current_set['start']) * 1000, 2); break; diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index e2a5066fc52..8bbdd915bd5 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -222,30 +222,6 @@ const CONFIG_STAGING_DIRECTORY = 'staging'; */ define('DRUPAL_ROOT', dirname(dirname(__DIR__))); -/** - * @deprecated as of Drupal 8.0. - * @see \Drupal\Component\Utility\Timer::start - */ -function timer_start($name) { - Timer::start($name); -} - -/** - * @deprecated as of Drupal 8.0. - * @see \Drupal\Component\Utility\Timer::read - */ -function timer_read($name) { - return Timer::read($name); -} - -/** - * @deprecated as of Drupal 8.0. - * @see \Drupal\Component\Utility\Timer::stop - */ -function timer_stop($name) { - return Timer::stop($name); -} - /** * Returns the appropriate configuration directory. * diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php index 4890dc9f8ae..95c3283701b 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewUI.php @@ -7,6 +7,7 @@ namespace Drupal\views_ui; +use Drupal\Component\Utility\Timer; use Drupal\views\Views; use Drupal\Core\Entity\EntityStorageControllerInterface; use Drupal\views\ViewExecutable; @@ -612,7 +613,7 @@ class ViewUI implements ViewStorageInterface { $show_additional_queries = $config->get('ui.show.additional_queries'); - timer_start('views_ui.preview'); + Timer::start('views_ui.preview'); if ($show_additional_queries) { $this->startQueryCapture(); @@ -626,7 +627,7 @@ class ViewUI implements ViewStorageInterface { $this->endQueryCapture(); } - $this->render_time = timer_stop('views_ui.preview'); + $this->render_time = Timer::stop('views_ui.preview'); views_ui_contextual_links_suppress_pop(); diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index e9f0ffe6462..230afd6ec20 100755 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -6,6 +6,7 @@ require_once __DIR__ . '/../vendor/autoload.php'; +use Drupal\Component\Utility\Timer; use Drupal\Core\StreamWrapper\PublicStream; const SIMPLETEST_SCRIPT_COLOR_PASS = 32; // Green. @@ -724,7 +725,7 @@ function simpletest_script_reporter_init() { echo "Test run started:\n"; echo " " . format_date($_SERVER['REQUEST_TIME'], 'long') . "\n"; - timer_start('run-tests'); + Timer::start('run-tests'); echo "\n"; echo "Test summary\n"; @@ -807,7 +808,7 @@ function simpletest_script_reporter_write_xml_results() { */ function simpletest_script_reporter_timer_stop() { echo "\n"; - $end = timer_stop('run-tests'); + $end = Timer::stop('run-tests'); echo "Test run duration: " . format_interval($end['time'] / 1000); echo "\n\n"; }