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>
50 lines
1.8 KiB
PHP
50 lines
1.8 KiB
PHP
<?php
|
|
/**
|
|
* Smarty Internal Plugin Compile Shared Inheritance
|
|
* Shared methods for {extends} and {block} tags
|
|
*
|
|
* @package Smarty
|
|
* @subpackage Compiler
|
|
* @author Uwe Tews
|
|
*/
|
|
|
|
/**
|
|
* Smarty Internal Plugin Compile Shared Inheritance Class
|
|
*
|
|
* @package Smarty
|
|
* @subpackage Compiler
|
|
*/
|
|
class Smarty_Internal_Compile_Shared_Inheritance extends Smarty_Internal_CompileBase
|
|
{
|
|
/**
|
|
* Compile inheritance initialization code as prefix
|
|
*
|
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
|
* @param bool|false $initChildSequence if true force child template
|
|
*/
|
|
public static function postCompile(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
|
|
{
|
|
$compiler->prefixCompiledCode .= "<?php \$_smarty_tpl->_loadInheritance();\n\$_smarty_tpl->inheritance->init(\$_smarty_tpl, " .
|
|
var_export($initChildSequence, true) . ");\n?>\n";
|
|
}
|
|
|
|
/**
|
|
* Register post compile callback to compile inheritance initialization code
|
|
*
|
|
* @param \Smarty_Internal_TemplateCompilerBase $compiler
|
|
* @param bool|false $initChildSequence if true force child template
|
|
*/
|
|
public function registerInit(Smarty_Internal_TemplateCompilerBase $compiler, $initChildSequence = false)
|
|
{
|
|
if ($initChildSequence || !isset($compiler->_cache[ 'inheritanceInit' ])) {
|
|
$compiler->registerPostCompileCallback(
|
|
array('Smarty_Internal_Compile_Shared_Inheritance', 'postCompile'),
|
|
array($initChildSequence),
|
|
'inheritanceInit',
|
|
$initChildSequence
|
|
);
|
|
$compiler->_cache[ 'inheritanceInit' ] = true;
|
|
}
|
|
}
|
|
}
|