<?php
/**
  @licence GPL 2005-2011  The osCSS developers - osCSS Open Source E-commerce
  @portion code Copyright (c) 2002 osCommerce
  @package osCSS-2 <www http://www.oscss.org>
  @version 2.1.0
  @date  12/02/11, 15:02
  @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  @encode UTF-8
  @brief this file for close core pages
*/

  //! close session
  $page->tep_session_close();
  //! write cache lang (.txt)
  $page->cache_lang(false);

  page::StopCacheVar();

  //! calcul et affichage info tps chargement
  $time_start = explode(' ', PAGE_PARSE_START_TIME);
  $time_end = explode(' ', microtime());
  $parse_time = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);

  if (_cst_bool('DISPLAY_PAGE_PARSE_TIME')) {
    $e=get_required_files();
    $f=get_defined_constants();
    $i=0;
    while ($r=each($f)){
      $i++;
      if($r['key']=='OSCSS_RV_COMPATIBILITY'){
        $c=array_slice($f,$i);
        continue;
      }
    }
    echo PHP_EOL."\t\t\t".'<div style="clear:both"><p class="conr" style="text-align:center">[ Generated in: ' . $parse_time . 's -- fichiers inclus: '.count($e).' -- constantes oscss:'.count($c).']</p>';
//     print_r($e);
    echo '</div>'."\n";
  }
  if(_cst_bool('STORE_PAGE_PARSE_TIME')) {
    trigger_error(sprintf(basename($_SERVER['REQUEST_URI']).' TEMPS EXECUTION TOTAL %s', $parse_time), E_USER_ERROR);
  }

  if(OSCSS_GARBAGE_ERROR == true) {
    if(OSCSS_DEBUG==true && $mock->is_count()) echo $mock->show();

      //! close Handler
    osC_ErrorHandler::stop();
  }
  /**
    TODO: Verifier si encore utile
    @date  07/06/10, 13:56
    @author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
  */
  if ( (_cst_bool('GZIP_COMPRESSION')) && ($ext_zlib_loaded == true) && ($ini_zlib_output_compression < 1) ) {
    if ( (PHP_VERSION < '4.0.4') && (PHP_VERSION >= '4') ) {
      tep_gzip_output(GZIP_LEVEL);
    }
  }
?>