Exemple #1
0
 public function saveToFile($path)
 {
     $path = ensure_file_ext($path, 'gif');
     $fp = fopen($path, 'w');
     fwrite($fp, $this->getAnimation());
     fclose($fp);
 }
Exemple #2
0
function saveResult2Html($tplName, $params = null, $__DIR__ = __DIR__, $htmlName = 'results.html', $title = null)
{
    $tplName = ensure_file_ext($tplName, 'tpl');
    $pageClass = cut_string_end($tplName, '.tpl');
    $body = PSSmarty::template("hometools/{$tplName}", $params)->fetch();
    $pageParams['title'] = $title == null ? 'Результаты' : $title;
    $pageParams['body'] = $body;
    $pageParams['class'] = $pageClass;
    $html = PSSmarty::template('hometools/page_pattern.tpl', $pageParams)->fetch();
    $htmlName = ensure_file_ext($htmlName, 'html');
    DirItem::inst($__DIR__, $htmlName)->writeToFile($html, true);
}
Exemple #3
0
function file_path($path, $name, $ext = null)
{
    return next_level_dir($path, ensure_file_ext($name, $ext));
}