• 12-06-2008, 12:30:19
    #1
    Üyeliği durduruldu
    Merhaba,
    sistemimde cache sistemi kullanıyorum. Bu kullandıgım fonksiyon php sayfalarını html olarak kayıt ediyor.

    ama 2 günde 1 cache yapısını yenilemesi için tarih fonksiyonu var çalışmıyor.
    Hiç cache yenilemesi yapmıyor yani

    $cachesystem = 'yes';
    $rootpath='./';
    $cache = 'cache';
    //---------------------------------
    //---- CACHE MOD v0.4 by xam
    //---------------------------------
    function cache_check ($file = 'cachefile') {
        global $cache,$rootpath,$cachesystem;    
        if ($cachesystem == 'yes') {
            $cachefile = $rootpath.$cache . '/'.$file.'.html';
            $cachetime = 2400 * 60; // 2 Hours     
            $updatetime = $cachetime / 60 / 60;
            if (file_exists($cachefile) && (TIMENOW - $cachetime < filemtime($cachefile)))
            {
                include_once($cachefile);
    //            print("<p align=center><font class=small color=red><b>This content was last cached on ".date('Y-m-d H:i:s', filemtime($cachefile))." and updating every ".$updatetime." hours.</b></font></p>");
                exit;
            }
            ob_start();
        }else
            return;
    }
      
    function cache_save  ($file = 'cachefile') {
        global $cache,$rootpath,$cachesystem;
        if ($cachesystem == 'yes') {
            $cachefile = $rootpath.$cache . '/'.$file.'.html';
            $fp = fopen($cachefile, 'w');
            fwrite($fp, ob_get_contents());      
            fclose($fp);        
            ob_end_flush();
        }else
            return;
    }
    //---------------------------------
    //---- CACHE MOD v0.4 by xam
    //---------------------------------
  • 12-06-2008, 22:09:44
    #2
    Üyeliği durduruldu
    Bakacak arkadaş yokmu?
  • 12-06-2008, 22:38:15
    #3
    date() kullanımını inceleyin derim
  • 13-06-2008, 10:33:11
    #4
    Üyeliği durduruldu
    phptr adlı üyeden alıntı: mesajı görüntüle
    date() kullanımını inceleyin derim
    biraz açıklama yaparsanız sevinirim.
  • 13-06-2008, 16:37:16
    #5
    Üyeliği durduruldu
    TIMENOW
    yerine
    time()
    yazın bi deneyin olmaz ise
    filemtime()
    bu fonksiyon açıkmı bir bakın.
  • 17-06-2008, 00:35:29
    #6
    Üyeliği durduruldu
    time denedim oda olmadı
  • 17-06-2008, 10:02:54
    #7
    Eposta Aktivasyonu Gerekmekte
    cache için yeterli alanın olmayabilir.