Bestehende Codebasis als Ausgangsstand aufgenommen. - .gitignore: Kundendaten (uploads_*), Smarty-Compile-Cache (templates_c), Laufzeit-Temp und Datenbank-Dumps ausgeschlossen; Verzeichnisstruktur ueber .gitkeep erhalten - .gitattributes: Zeilenenden normalisiert (LF im Repo), Binaerformate markiert - db-backup.php: MySQL-Zugangsdaten kommen jetzt wie im Rest der Anwendung aus der externen Konfiguration statt hartkodiert aus der Datei; Passwort wird ueber eine temporaere Optionsdatei statt per Kommandozeile uebergeben, Fehler von mysqldump/gzip werden gemeldet, Aufraeumen aelterer Backups berechnet Jahr und Monat konsistent Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
27 lines
712 B
PHP
27 lines
712 B
PHP
<?php
|
|
/**
|
|
* Smarty plugin
|
|
*
|
|
* @package Smarty
|
|
* @subpackage PluginsModifier
|
|
*/
|
|
|
|
/**
|
|
* Smarty number_format modifier plugin
|
|
* Type: modifier
|
|
* Name: number_format
|
|
* Purpose: Format a number with grouped thousands
|
|
*
|
|
* @param float|null $num
|
|
* @param int $decimals
|
|
* @param string|null $decimal_separator
|
|
* @param string|null $thousands_separator
|
|
*
|
|
* @return string
|
|
*/
|
|
function smarty_modifier_number_format(?float $num, int $decimals = 0, ?string $decimal_separator = ".", ?string $thousands_separator = ",")
|
|
{
|
|
// provide $num default to prevent deprecation errors in PHP >=8.1
|
|
return number_format($num ?? 0.0, $decimals, $decimal_separator, $thousands_separator);
|
|
}
|