<commit_before><?php
/**
 * DebugKitEx Resque Panel View
 *
 * Copyright (c) 2012, <NAME> (Kamisama)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @author 		<NAME> <<EMAIL>>
 * @copyright 	Copyright 2012, <NAME> <<EMAIL>>
 * @link 		https://github.com/kamisama/DebugKitEx
 * @package 	DebugKitEx
 * @subpackage 	DebugKitEx.View.Elements
 * @since 		2.2.1
 * @license 	MIT License (http://www.opensource.org/licenses/mit-license.php)
 */


?>
<h2><?php echo __d('debug_kit_ex', 'Resque Jobs Logs')?></h2>
<?php if (!empty($content)) : ?>
	<?php foreach ($content as $queue => $jobs): ?>
	<div class="sql-log-panel-query-log">
		<div class="head-bloc"><h4 title="<?php echo $queue ?> queue"><?php echo $queue ?></h4></div>
		<?php

			if (!empty($jobs))
			{
				echo '<table class="debug-table debug_ex-table">';
				echo '<tr>';
				echo '<th>'.__d('debug_kit_ex', 'Job Id').'</th>';
				echo '<th>'.__d('debug_kit_ex', 'Job Class').'</th>';
				echo '<th>'.__d('debug_kit_ex', 'Method').'</th>';
				echo '<th>'.__d('debug_kit_ex', 'From').'</th>';
				echo '</tr>';

				$totalJobs = 0;
				foreach($jobs as $job)
				{
					echo '<tr>';
					echo '<td>#'.$job['jobId']. '</td>';
					echo '<td>'.$job['class']. '</td>';
					echo '<td>'.$job['method']. '</td>';
					echo '<td>' . sprintf('%s <small class="trace_line">line %s</small>', str_replace(APP, '', $job['caller'][0]['file']), $job['caller'][0]['line']);
					echo '<pre class="code-on-demand"><code>'.var_export($job['args'], true). '</code></pre>';
					echo '</td>';
					echo '</tr>';

					$totalJobs++;

				}

				echo '<tr class="table-summary">';
				echo '<td colspan=4 style="text-align:center">';
				echo __dn('debug_kit_ex', '%d job', '%d jobs', $totalJobs, $totalJobs);
				echo '</td>';
				echo '</tr>';

				echo '</table>';
			}
		 ?>

	</div>
	<?php endforeach; ?>
<?php else:
	echo $this->Toolbar->message('', __d('debug_kit_ex', 'No jobs activities'));
endif; ?><commit_msg>Gracefully handle error when CakeResque plugin is not found<commit_after><?php
/**
 * DebugKitEx Resque Panel View
 *
 * Copyright (c) 2012, <NAME> (Kamisama)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @author 		<NAME> <<EMAIL>>
 * @copyright 	Copyright 2012, <NAME> <<EMAIL>>
 * @link 		https://github.com/kamisama/DebugKitEx
 * @package 	DebugKitEx
 * @subpackage 	DebugKitEx.View.Elements
 * @since 		2.2.1
 * @license 	MIT License (http://www.opensource.org/licenses/mit-license.php)
 */


?>
<h2><?php echo __d('debug_kit_ex', 'Resque Jobs Logs')?></h2>
<?php if (!empty($content)) : ?>
	<?php foreach ($content as $queue => $jobs): ?>
	<div class="sql-log-panel-query-log">
		<div class="head-bloc"><h4 title="<?php echo $queue ?> queue"><?php echo $queue ?></h4></div>
		<?php

			if (!empty($jobs))
			{
				echo '<table class="debug-table debug_ex-table">';
				echo '<tr>';
				echo '<th>'.__d('debug_kit_ex', 'Job Id').'</th>';
				echo '<th>'.__d('debug_kit_ex', 'Job Class').'</th>';
				echo '<th>'.__d('debug_kit_ex', 'Method').'</th>';
				echo '<th>'.__d('debug_kit_ex', 'From').'</th>';
				echo '</tr>';

				$totalJobs = 0;
				foreach($jobs as $job)
				{
					echo '<tr>';
					echo '<td>#'.$job['jobId']. '</td>';
					echo '<td>'.$job['class']. '</td>';
					echo '<td>'.$job['method']. '</td>';
					echo '<td>' . sprintf('%s <small class="trace_line">line %s</small>', str_replace(APP, '', $job['caller'][0]['file']), $job['caller'][0]['line']);
					echo '<pre class="code-on-demand"><code>'.var_export($job['args'], true). '</code></pre>';
					echo '</td>';
					echo '</tr>';

					$totalJobs++;

				}

				echo '<tr class="table-summary">';
				echo '<td colspan=4 style="text-align:center">';
				echo __dn('debug_kit_ex', '%d job', '%d jobs', $totalJobs, $totalJobs);
				echo '</td>';
				echo '</tr>';

				echo '</table>';
			}
		 ?>

	</div>
	<?php endforeach; ?>
<?php elseif ($content === null): ?>
	<div class="alert-error">CakeResque plugin not found</div>
<?php else:
	echo $this->Toolbar->message('', __d('debug_kit_ex', 'No jobs activities'));
endif; ?>
{'fraction_non_alphanumeric': 0.2473143948436381, 'fraction_numerical': 0.00907137741704464, 'mean_word_length': 3.7237880496054117, 'pattern_counts': {'":': 0, '<': 118, '<?xml version=': 0, '>': 124, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5299475', 'n_tokens_mistral': 1736, 'n_tokens_neox': 1507, 'n_words': 343}