<?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

  Gestion du cache des fichier de configuration

*/
  $key=md5(__FILE__);

  $file[]=DIR_WS_INCLUDES . 'database_tables.php';
  $file[]=DIR_WS_INCLUDES . 'filenames.php';
  if (file_exists(DIR_WS_INCLUDES . 'tables_files_modules.php'))$file[]=DIR_WS_INCLUDES . 'tables_files_modules.php';

  if(!file_exists(DIR_FS_WORK.$key.'.cache') && (OSCSS_DEBUG == false) ){

    $fp=fopen(DIR_FS_WORK.$key.'.cache','w');
    flock($fp, 2); // LOCK_EX
    foreach($file as $item) {
      if(file_exists($item) )fputs($fp, file_get_contents($item));
    }
    flock($fp, 3); // LOCK_UN
    fclose($fp);
    include(DIR_FS_WORK.$key.'.cache');

  }
  elseif(OSCSS_DEBUG == true){
    foreach($file as $item)
      include_once($item);

  }
  else include(DIR_FS_WORK.$key.'.cache');

  unset($file);

?>