From a8bfd3cf7ab7be2da686f08d838e8e8feda21960 Mon Sep 17 00:00:00 2001 From: bruno Date: Fri, 16 Jun 2023 15:08:38 -0400 Subject: [PATCH] =?UTF-8?q?Todas=20as=20chamada=20strftime=20foram=20renom?= =?UTF-8?q?eadas=20para=20strftime=5F.=20Fun=C3=A7=C3=A3o=20strftime=20est?= =?UTF-8?q?=C3=A1=20descontinuada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../internals/core.write_compiled_include.php | 2 +- .../plugins/function.html_select_date.php | 8 ++-- .../plugins/function.html_select_time.php | 8 ++-- img/libs/plugins/modifier.date_format.php | 2 +- include/jpgraph/jpgraph_gantt.php | 44 +++++++++---------- include/libs/Smarty.class.php | 2 +- .../plugins/function.html_select_date.php | 6 +-- include/libs/plugins/modifier.date_format.php | 2 +- include/util/datas.php | 12 ++--- .../callcenter/metas/metricasDiaria.php | 2 +- .../callcenter/metas/metricasDiariaServ.php | 2 +- 11 files changed, 45 insertions(+), 45 deletions(-) diff --git a/img/libs/internals/core.write_compiled_include.php b/img/libs/internals/core.write_compiled_include.php index d56c53f1..b1a827d7 100644 --- a/img/libs/internals/core.write_compiled_include.php +++ b/img/libs/internals/core.write_compiled_include.php @@ -24,7 +24,7 @@ function smarty_core_write_compiled_include($params, &$smarty) { return; // convert the matched php-code to functions - $_include_compiled = "_version . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . "\n"; + $_include_compiled = "_version . ", created on " . strftime_("%Y-%m-%d %H:%M:%S") . "\n"; $_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F' => '/', '%3A' => ':')) . " */\n\n"; $_compile_path = $params['include_file_path']; diff --git a/img/libs/plugins/function.html_select_date.php b/img/libs/plugins/function.html_select_date.php index b2873f2e..059179a3 100644 --- a/img/libs/plugins/function.html_select_date.php +++ b/img/libs/plugins/function.html_select_date.php @@ -143,7 +143,7 @@ function smarty_function_html_select_date($params, &$smarty) { } else { // use smarty_make_timestamp to get an unix timestamp and // strftime to make yyyy-mm-dd - $time = strftime('%Y-%m-%d', smarty_make_timestamp($time)); + $time = strftime_('%Y-%m-%d', smarty_make_timestamp($time)); } // Now split this in pieces, which later can be used to set the select $time = explode("-", $time); @@ -188,8 +188,8 @@ function smarty_function_html_select_date($params, &$smarty) { $month_values[''] = ''; } for ($i = 1; $i <= 12; $i++) { - $month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000)); - $month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000)); + $month_names[$i] = strftime_($month_format, mktime(0, 0, 0, $i, 1, 2000)); + $month_values[$i] = strftime_($month_value_format, mktime(0, 0, 0, $i, 1, 2000)); } $month_result .= ''; } diff --git a/img/libs/plugins/function.html_select_time.php b/img/libs/plugins/function.html_select_time.php index 8600cd1a..0dd83734 100644 --- a/img/libs/plugins/function.html_select_time.php +++ b/img/libs/plugins/function.html_select_time.php @@ -100,7 +100,7 @@ function smarty_function_html_select_time($params, &$smarty) { $html_result .= '>' . "\n"; $html_result .= smarty_function_html_options(array('output' => $hours, 'values' => $hours, - 'selected' => strftime($hour_fmt, $time), + 'selected' => strftime_($hour_fmt, $time), 'print_result' => false), $smarty); $html_result .= "\n"; } @@ -109,7 +109,7 @@ function smarty_function_html_select_time($params, &$smarty) { $all_minutes = range(0, 59); for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i += $minute_interval) $minutes[] = sprintf('%02d', $all_minutes[$i]); - $selected = intval(floor(strftime('%M', $time) / $minute_interval) * $minute_interval); + $selected = intval(floor(strftime_('%M', $time) / $minute_interval) * $minute_interval); $html_result .= '\n"; } diff --git a/img/libs/plugins/modifier.date_format.php b/img/libs/plugins/modifier.date_format.php index 7ee79934..b9c11e51 100644 --- a/img/libs/plugins/modifier.date_format.php +++ b/img/libs/plugins/modifier.date_format.php @@ -50,7 +50,7 @@ function smarty_modifier_date_format($string, $format = '%b %e, %Y', $default_da } $format = str_replace($_win_from, $_win_to, $format); } - return strftime($format, $timestamp); + return strftime_($format, $timestamp); } /* vim: set expandtab: */ diff --git a/include/jpgraph/jpgraph_gantt.php b/include/jpgraph/jpgraph_gantt.php index d5afa654..405572c8 100644 --- a/include/jpgraph/jpgraph_gantt.php +++ b/include/jpgraph/jpgraph_gantt.php @@ -2128,8 +2128,8 @@ class GanttScale { } // Get day in week for start and ending date (Sun==0) - $ds=strftime("%w",$this->iStartDate); - $de=strftime("%w",$this->iEndDate); + $ds=strftime_("%w",$this->iStartDate); + $de=strftime_("%w",$this->iEndDate); // We want to start on iWeekStart day. But first we subtract a week // if the startdate is "behind" the day the week start at. @@ -2216,11 +2216,11 @@ class GanttScale { // Get week number function GetWeekNbr($aDate,$aSunStart=true) { - // We can't use the internal strftime() since it gets the weeknumber + // We can't use the internal strftime_() since it gets the weeknumber // wrong since it doesn't follow ISO on all systems since this is // system linrary dependent. // Even worse is that this works differently if we are on a Windows - // or UNIX box (it even differs between UNIX boxes how strftime() + // or UNIX box (it even differs between UNIX boxes how strftime_() // is natively implemented) // // Credit to Nicolas Hoizey for this elegant @@ -2278,17 +2278,17 @@ class GanttScale { // Get day in month function GetMonthDayNbr($aDate) { - return 0+strftime("%d",$aDate); + return 0+strftime_("%d",$aDate); } // Get day in year function GetYearDayNbr($aDate) { - return 0+strftime("%j",$aDate); + return 0+strftime_("%j",$aDate); } // Get month number function GetMonthNbr($aDate) { - return 0+strftime("%m",$aDate); + return 0+strftime_("%m",$aDate); } // Translate a date to screen coordinates (horizontal scale) @@ -2599,63 +2599,63 @@ class GanttScale { $x+$daywidth,$yb-$this->day->iFrameWeight); } - $mn = strftime('%m',$datestamp); + $mn = strftime_('%m',$datestamp); if( $mn[0]=='0' ) $mn = $mn[1]; switch( $this->day->iStyle ) { case DAYSTYLE_LONG: // "Monday" - $txt = strftime('%A',$datestamp); + $txt = strftime_('%A',$datestamp); break; case DAYSTYLE_SHORT: // "Mon" - $txt = strftime('%a',$datestamp); + $txt = strftime_('%a',$datestamp); break; case DAYSTYLE_SHORTDAYDATE1: // "Mon 23/6" - $txt = strftime('%a %d/'.$mn,$datestamp); + $txt = strftime_('%a %d/'.$mn,$datestamp); break; case DAYSTYLE_SHORTDAYDATE2: // "Mon 23 Jun" - $txt = strftime('%a %d %b',$datestamp); + $txt = strftime_('%a %d %b',$datestamp); break; case DAYSTYLE_SHORTDAYDATE3: // "Mon 23 Jun 2003" - $txt = strftime('%a %d %b %Y',$datestamp); + $txt = strftime_('%a %d %b %Y',$datestamp); break; case DAYSTYLE_LONGDAYDATE1: // "Monday 23 Jun" - $txt = strftime('%A %d %b',$datestamp); + $txt = strftime_('%A %d %b',$datestamp); break; case DAYSTYLE_LONGDAYDATE2: // "Monday 23 Jun 2003" - $txt = strftime('%A %d %b %Y',$datestamp); + $txt = strftime_('%A %d %b %Y',$datestamp); break; case DAYSTYLE_SHORTDATE1: // "23/6" - $txt = strftime('%d/'.$mn,$datestamp); + $txt = strftime_('%d/'.$mn,$datestamp); break; case DAYSTYLE_SHORTDATE2: // "23 Jun" - $txt = strftime('%d %b',$datestamp); + $txt = strftime_('%d %b',$datestamp); break; case DAYSTYLE_SHORTDATE3: // "Mon 23" - $txt = strftime('%a %d',$datestamp); + $txt = strftime_('%a %d',$datestamp); break; case DAYSTYLE_SHORTDATE4: // "23" - $txt = strftime('%d',$datestamp); + $txt = strftime_('%d',$datestamp); break; case DAYSTYLE_CUSTOM: // Custom format - $txt = strftime($this->day->iLabelFormStr,$datestamp); + $txt = strftime_($this->day->iLabelFormStr,$datestamp); break; case DAYSTYLE_ONELETTER: default: // "M" - $txt = strftime('%A',$datestamp); + $txt = strftime_('%A',$datestamp); $txt = strtoupper($txt[0]); break; } @@ -2808,7 +2808,7 @@ class GanttScale { $img->SetLineWeight($this->month->grid->iWeight); $img->SetColor($this->month->iTextColor); - $year = 0+strftime("%Y",$this->iStartDate); + $year = 0+strftime_("%Y",$this->iStartDate); $img->SetTextAlign("center"); if( $this->GetMonthNbr($this->iStartDate) == $this->GetMonthNbr($this->iEndDate) && $this->GetYear($this->iStartDate)==$this->GetYear($this->iEndDate) ) { diff --git a/include/libs/Smarty.class.php b/include/libs/Smarty.class.php index 5351b579..e94dce7e 100644 --- a/include/libs/Smarty.class.php +++ b/include/libs/Smarty.class.php @@ -173,7 +173,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * The date format to be used internally - * (accepts date() and strftime()) + * (accepts date() and strftime_()) */ public static $_DATE_FORMAT = '%b %e, %Y'; diff --git a/include/libs/plugins/function.html_select_date.php b/include/libs/plugins/function.html_select_date.php index d9c57197..4addfd3c 100644 --- a/include/libs/plugins/function.html_select_date.php +++ b/include/libs/plugins/function.html_select_date.php @@ -167,7 +167,7 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem break; } } - // Note: date() is faster than strftime() + // Note: date() is faster than strftime_() // Note: explode(date()) is faster than date() date() date() if (isset($time) && is_array($time)) { @@ -316,8 +316,8 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem for ($i = 1; $i <= 12; $i++) { $_val = sprintf('%02d', $i); $_text = isset($month_names) ? smarty_function_escape_special_chars($month_names[ $i ]) : - ($month_format === '%m' ? $_val : @strftime($month_format, $_month_timestamps[ $i ])); - $_value = $month_value_format === '%m' ? $_val : @strftime($month_value_format, $_month_timestamps[ $i ]); + ($month_format === '%m' ? $_val : @strftime_($month_format, $_month_timestamps[ $i ])); + $_value = $month_value_format === '%m' ? $_val : @strftime_($month_value_format, $_month_timestamps[ $i ]); $_html_months .= '' . $option_separator; } diff --git a/include/libs/plugins/modifier.date_format.php b/include/libs/plugins/modifier.date_format.php index e3589fd0..d1239478 100644 --- a/include/libs/plugins/modifier.date_format.php +++ b/include/libs/plugins/modifier.date_format.php @@ -79,7 +79,7 @@ function smarty_modifier_date_format($string, $format = null, $default_date = '' $format = str_replace($_win_from, $_win_to, $format); } // @ to suppress deprecation errors when running in PHP8.1 or higher. - return @strftime($format, $timestamp); + return @strftime_($format, $timestamp); } else { return date($format, $timestamp); } diff --git a/include/util/datas.php b/include/util/datas.php index 65471e41..064df17f 100644 --- a/include/util/datas.php +++ b/include/util/datas.php @@ -35,7 +35,7 @@ class CalcDataHora { private $fmtDef = array("d" => 0, "m" => 1, "y" => 2, "h" => 0, "i" => 1, "s" => 2); public function somaDia($dias = 1) { - $this->CalcDataHora(strftime("%d/%m/%Y", mktime(0, 0, 0, $this->data[1], $this->data[0] + + $this->CalcDataHora(strftime_("%d/%m/%Y", mktime(0, 0, 0, $this->data[1], $this->data[0] + $dias, $this->data[2])), ""); return $this->data; @@ -79,14 +79,14 @@ class CalcDataHora { } public function somaMes($meses = 1) { - $this->CalcDataHora(strftime("%d/%m/%Y", mktime(0, 0, 0, $this->data[1] + + $this->CalcDataHora(strftime_("%d/%m/%Y", mktime(0, 0, 0, $this->data[1] + $meses, $this->data[0], $this->data[2])), ""); return $this->data; } public function somaAno($anos = 1) { - $this->CalcDataHora(strftime("%d/%m/%Y", mktime(0, 0, 0, $this->data[1], $this->data[0], $this->data[2] + + $this->CalcDataHora(strftime_("%d/%m/%Y", mktime(0, 0, 0, $this->data[1], $this->data[0], $this->data[2] + $anos)), ""); return $this->data; @@ -130,21 +130,21 @@ class CalcDataHora { // HORA public function somaSegundo($segundos = 1) { - $this->CalcDataHora("", strftime("%H:%M:%S", mktime($this->hora[0], $this->hora[1], $this->hora[2] + + $this->CalcDataHora("", strftime_("%H:%M:%S", mktime($this->hora[0], $this->hora[1], $this->hora[2] + $segundos, 0, 0, 0))); return $this->hora; } public function somaMinuto($minutos = 1) { - $this->CalcDataHora("", strftime("%H:%M:%S", mktime($this->hora[0], $this->hora[1] + + $this->CalcDataHora("", strftime_("%H:%M:%S", mktime($this->hora[0], $this->hora[1] + $minutos, $this->hora[2], 0, 0, 0))); return $this->hora; } public function somaHora($horas = 1) { - $this->CalcDataHora("", strftime("%H:%M:%S", mktime($this->hora[0] + + $this->CalcDataHora("", strftime_("%H:%M:%S", mktime($this->hora[0] + $horas, $this->hora[1], $this->hora[2], 0, 0, 0))); return $this->hora; diff --git a/relatorios/callcenter/metas/metricasDiaria.php b/relatorios/callcenter/metas/metricasDiaria.php index 73dc2c25..b5fd8b52 100644 --- a/relatorios/callcenter/metas/metricasDiaria.php +++ b/relatorios/callcenter/metas/metricasDiaria.php @@ -652,7 +652,7 @@ class RelMetricasDiaria extends Relatorios { "%s" . "Total Chamadas" . "Tempo Médio (Segundos)" - . "", ucfirst(strftime('%B', strtotime(FormatDtMssql($this->___dataIni))))); + . "", ucfirst(strftime_('%B', strtotime(FormatDtMssql($this->___dataIni))))); $linha .= ""; $dataRel[] = $linha; diff --git a/relatorios/callcenter/metas/metricasDiariaServ.php b/relatorios/callcenter/metas/metricasDiariaServ.php index 1434c7c7..ad6fa201 100644 --- a/relatorios/callcenter/metas/metricasDiariaServ.php +++ b/relatorios/callcenter/metas/metricasDiariaServ.php @@ -607,7 +607,7 @@ "%s" . "Total Chamadas" . "Tempo Médio (Segundos)" - . "", ucfirst(strftime('%B', strtotime(FormatDtMssql($this->___dataIni))))); + . "", ucfirst(strftime_('%B', strtotime(FormatDtMssql($this->___dataIni))))); $linha .= ""; $dataRel[] = $linha;