Diff-REALMCTECHNIK-227.diff

Patch - Daniel Siepmann, 2013-09-17 14:01

Download (3.29 KB)

View differences:

typo3/sysext/cms/tslib/class.tslib_content.php Tue Sep 17 13:05:30 2013 +0200
7299 7299
           // Init vars:
7300 7300
       $allFields = 'uid,hidden,starttime,endtime,fe_group,extendToSubpages,doktype,php_tree_stop,mount_pid,mount_pid_ol,t3ver_state' .
7301 7301
           $addSelectFields;
7302
       $expires = (int)$GLOBALS['SIM_ACCESS_TIME'] + (24 * 60 * 60); // Now + 24 hours.
7302 7303
       $depth = intval($depth);
7303 7304
       $begin = intval($begin);
7304 7305
       $id = intval($id);
......
7329 7330
               $cacheEntry = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
7330 7331
                   'treelist',
7331 7332
                   'cache_treelist',
7332
                   'md5hash = \'' . $requestHash . '\' AND ( expires > ' . $GLOBALS['EXEC_TIME'] .
7333
                   'md5hash = \'' . $requestHash . '\' AND ( expires > ' . $GLOBALS['SIM_ACCESS_TIME'] .
7333 7334
                   ' OR expires = 0 )'
7334 7335
               );
7335 7336

  
7336
               if (is_array($cacheEntry)) {
7337
               if (is_array($cacheEntry) && !$GLOBALS['TSFE']->no_cache) {
7337 7338
                       // cache hit
7338 7339
                   return $cacheEntry['treelist'];
7339 7340
               }
......
7411 7412
                           continue;
7412 7413
                       }
7413 7414
                   }
7415

  
7416
                   // Get expires value from pages:
7417
                   //      Check each page for lower starttime or endtime then current expires.
7418
                   //      Use it as new expires. The expires will be the time when first page will change.
7419
                   // ~ Daniel Siepmann <Daniel.Siepmann@wfp2.com>
7420
                   $starttime = (int)$row['starttime'];
7421
                   $endtime = (int)$row['endtime'];
7422
                   if ($starttime !== 0 && $starttime < $expires && $starttime > (int)$GLOBALS['SIM_ACCESS_TIME']) {
7423
                       $expires = $starttime;
7424
                   }
7425
                   if ($endtime !== 0 && $endtime < $expires && $endtime > (int)$GLOBALS['SIM_ACCESS_TIME']) {
7426
                       $expires = $endtime;
7427
                   }
7428
                   unset( $starttime );
7429
                   unset( $endtime );
7430

  
7414 7431
                       // Add record:
7415 7432
                   if ($dontCheckEnableFields || $GLOBALS['TSFE']->checkPagerecordForIncludeSection($row)) {
7416 7433
                           // Add ID to list:
......
7454 7471
                   }
7455 7472
               }
7456 7473

  
7474
               if (!$GLOBALS['TSFE']->no_cache) {
7475
                   $GLOBALS['TYPO3_DB']->exec_DELETEquery(
7476
                       'cache_treelist',
7477
                       'md5hash = "' . $requestHash . '"'
7478
                   );
7479

  
7457 7480
               $GLOBALS['TYPO3_DB']->exec_INSERTquery(
7458 7481
                   'cache_treelist',
7459 7482
                   array(
7460 7483
                       'md5hash' => $requestHash,
7461 7484
                       'pid' => $id,
7462 7485
                       'treelist' => $theList,
7463
                       'tstamp' => $GLOBALS['EXEC_TIME']
7486
                           'tstamp' => $GLOBALS['EXEC_TIME'],
7487
                           'expires' => $expires,
7464 7488
                   )
7465 7489
               );
7466 7490
           }
7467 7491
       }
7492
       }
7468 7493
           // Return list:
7469 7494
       return $theList;
7470 7495
   }