コード例 #1
0
 public static function html($key, $params = array(), $cacheID = null, $cachetime = -1)
 {
     if ($cacheID != null) {
         if ($cacheID == -1) {
             $cacheID = md5($key . serialize($params));
         }
         $a = fcache::read($cacheID, $cachetime);
         if ($a != null) {
             echo $a;
             return;
         }
         ob_start();
     }
     $file = self::html_find($key);
     if ($file != null) {
         if (defined("debug")) {
             self::$_debuglog["html"][] = array("page" => $key, "file" => $file, "timestamp" => microtime(true));
         }
         include $file;
         if ($cacheID != null) {
             fcache::write($cacheID, ob_get_flush());
         }
         return;
     }
     if (defined("debug")) {
         trigger_error("Seite " . $key . " kann nicht gefunden werden.", E_USER_WARNING);
     }
 }
コード例 #2
0
 public static function init($lang, $domain = "frontend")
 {
     /*self::$_locale = setlocale( LC_MESSAGES, 	$lang.".utf8",
                     $lang.".UTF8",
                     $lang.".utf-8",
                     $lang.".UTF-8",
                     $lang);
     		putenv("LANG=".$lang."");
     		bindtextdomain( $domain, $_ENV["basepath"].'/locales/');
     		bind_textdomain_codeset($domain, "UTF-8");
     		return true;*/
     $cacheID = "SprachLocale_" . $lang . "_" . $domain;
     self::$_data = fcache::read($cacheID, 86400 * 30);
     if (self::$_data == null) {
         self::$_data = self::convertPOFile($lang, $domain);
         fcache::write($cacheID, self::$_data);
     }
     return true;
 }
コード例 #3
0
<?php

@header("Content-Type: text/css; Charset: UTF-8");
$expires = 3600;
@header("Pragma: public");
@header("Cache-Control: maxage=" . $expires);
@header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');
$a = fcache::read(__FILE__, 3600);
if ($a != null) {
    die($a);
}
$db = new SQL(0);
$rows = $db->cmdrows(0, 'SELECT tag,icon_URL FROM tag_details WHERE icon_URL != ""');
$out = "";
foreach ($rows as $row) {
    $out .= '.tags a.tag.' . niceClass($row["tag"]) . ' { background: #F3F6F6 url(\'' . $row["icon_URL"] . '\') no-repeat left center; background-size: 16px 16px; padding-left: 18px; }' . PHP_EOL;
}
$out .= '/***cached at ' . date("d.m.Y H:i:s") . ' ***/' . PHP_EOL;
fcache::write(__FILE__, $out);
echo $out;
exit(1);
コード例 #4
0
 public static function setTempDir($path)
 {
     if (substr($path, -1) == "/") {
         $path = substr($path, 0, strlen($path) - 1);
     }
     self::$_tempdir = $path;
 }