Created
May 6, 2011 02:32
-
-
Save fsouza/958346 to your computer and use it in GitHub Desktop.
Script usado para salvar estáticos do Dev in Cachu (feião :P)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('libs/Smarty.class.php'); | |
require('util.php'); | |
$smarty = new Smarty; | |
$smarty->assign('titulo', 'Avaliação'); | |
$html = $smarty->fetch('avaliacao.tpl'); | |
save_cached_content($html, 'avaliacao.html'); | |
$smarty->assign('titulo', 'Caravanas'); | |
$html = $smarty->fetch('caravanas.tpl'); | |
save_cached_content($html, 'caravanas.html'); | |
$smarty->assign('titulo', '30 de abril'); | |
$html = $smarty->fetch('index.tpl'); | |
save_cached_content($html, 'index.html'); | |
$smarty->assign('titulo', 'Faça sua inscrição'); | |
$html = $smarty->fetch('inscricao.tpl'); | |
save_cached_content($html, 'inscricao.html'); | |
$smarty->assign('titulo', 'Palestrantes'); | |
$html = $smarty->fetch('palestrantes.tpl'); | |
save_cached_content($html, 'palestrantes.html'); | |
$smarty->assign('titulo', 'Patrocínio'); | |
$html = $smarty->fetch('patrocinio.tpl'); | |
save_cached_content($html, 'patrocinio.html'); | |
$smarty->assign('titulo', 'Programação e Palestras'); | |
$html = $smarty->fetch('programacao.tpl'); | |
save_cached_content($html, 'programacao.html'); | |
$smarty->assign('titulo', 'Quando e Onde'); | |
$html = $smarty->fetch('quando-e-onde.tpl'); | |
save_cached_content($html, 'quando-e-onde.html'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function save_cached_content($content, $filename) { | |
$fp = fopen(sprintf("/home/devincachu/static_devincachu/%s", $filename), "w"); | |
fprintf($fp, "%s", $content); | |
fclose($fp); | |
echo "Saved: ".$filename."<br />"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Faz tempo que não via um código com Smarty, bacana! :)