Skip to content

Commit 9451351

Browse files
committed
Merge branch 'develop' of github.com:bcit-ci/CodeIgniter4 into develop
2 parents 9deaff1 + def9426 commit 9451351

4 files changed

Lines changed: 8 additions & 53 deletions

File tree

system/Debug/Toolbar.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,13 @@ protected static function format(string $data, string $format = 'html')
230230

231231
for ($i = 0; $i < $total; $i++)
232232
{
233+
// Oldest files will be deleted
234+
if ($app->toolbarMaxHistory >= 0 && $i+1 > $app->toolbarMaxHistory)
235+
{
236+
unlink($filenames[$i]);
237+
continue;
238+
}
239+
233240
// Get the contents of this specific history request
234241
ob_start();
235242
include($filenames[$i]);
@@ -239,7 +246,7 @@ protected static function format(string $data, string $format = 'html')
239246
$file = json_decode($contents, true);
240247

241248
// Debugbar files shown in History Collector
242-
$files[$i] = [
249+
$files[] = [
243250
'time' => (int)$time = substr($filenames[$i], -10),
244251
'datetime' => date('Y-m-d H:i:s', $time),
245252
'active' => (int)($time == $current),
@@ -249,13 +256,6 @@ protected static function format(string $data, string $format = 'html')
249256
'isAJAX' => $file['isAJAX'] ? 'Yes' : 'No',
250257
'contentType' => $file['vars']['response']['contentType'],
251258
];
252-
253-
// Oldest files will be deleted
254-
if ($app->toolbarMaxHistory >= 0 && $i >= $app->toolbarMaxHistory)
255-
{
256-
unlink($filenames[$i]);
257-
continue;
258-
}
259259
}
260260

261261
// Set the History here. Class is not necessary

system/Helpers/form_helper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,10 @@ function form_open(string $action = '', $attributes = [], array $hidden = []): s
5858
// If no action is provided then set to the current url
5959
if ( ! $action)
6060
{
61-
helper('url');
6261
$action = current_url(true);
6362
} // If an action is not a full URL then turn it into one
6463
elseif (strpos($action, '://') === false)
6564
{
66-
helper('url');
6765
$action = site_url($action);
6866
}
6967

system/View/Parser.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -297,25 +297,6 @@ protected function parse(string $template, array $data = [], array $options = nu
297297
}
298298

299299
//--------------------------------------------------------------------
300-
//FIXME the following method does not appear to be used anywhere, so commented out
301-
// protected function is_assoc($arr)
302-
// {
303-
// return array_keys($arr) !== range(0, count($arr) - 1);
304-
// }
305-
//--------------------------------------------------------------------
306-
//FIXME the following method does not appear to be used anywhere, so commented out
307-
// function strpos_all($haystack, $needle)
308-
// {
309-
// $offset = 0;
310-
// $allpos = [];
311-
// while (($pos = strpos($haystack, $needle, $offset)) !== FALSE)
312-
// {
313-
// $offset = $pos + 1;
314-
// $allpos[] = $pos;
315-
// }
316-
// return $allpos;
317-
// }
318-
//--------------------------------------------------------------------
319300

320301
/**
321302
* Parse a single key/value, extracting it

system/View/Plugins.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ class Plugins
4545
*/
4646
public static function currentURL(array $params = [])
4747
{
48-
if ( ! function_exists('current_url'))
49-
// can't unit test this since it is loaded in CIUnitTestCase setup
50-
// @codeCoverageIgnoreStart
51-
helper('url');
52-
// @codeCoverageIgnoreEnd
53-
5448
return current_url();
5549
}
5650

@@ -63,12 +57,6 @@ public static function currentURL(array $params = [])
6357
*/
6458
public static function previousURL(array $params = [])
6559
{
66-
if ( ! function_exists('previous_url'))
67-
// can't unit test this since it is loaded in CIUnitTestCase setup
68-
// @codeCoverageIgnoreStart
69-
helper('url');
70-
// @codeCoverageIgnoreEnd
71-
7260
return previous_url();
7361
}
7462

@@ -81,12 +69,6 @@ public static function previousURL(array $params = [])
8169
*/
8270
public static function mailto(array $params = [])
8371
{
84-
if ( ! function_exists('mailto'))
85-
// can't unit test this since it is loaded in CIUnitTestCase setup
86-
// @codeCoverageIgnoreStart
87-
helper('url');
88-
// @codeCoverageIgnoreEnd
89-
9072
$email = $params['email'] ?? '';
9173
$title = $params['title'] ?? '';
9274
$attrs = $params['attributes'] ?? '';
@@ -103,12 +85,6 @@ public static function mailto(array $params = [])
10385
*/
10486
public static function safeMailto(array $params = [])
10587
{
106-
if ( ! function_exists('safe_mailto'))
107-
// can't unit test this since it is loaded in CIUnitTestCase setup
108-
// @codeCoverageIgnoreStart
109-
helper('url');
110-
// @codeCoverageIgnoreEnd
111-
11288
$email = $params['email'] ?? '';
11389
$title = $params['title'] ?? '';
11490
$attrs = $params['attributes'] ?? '';

0 commit comments

Comments
 (0)