<?php
namespace imcat;
function code($key){
$skips = ['xvars/dtmp/']; // 'cfgs/boot/','cfgs/excfg/',
foreach ($skips as $sk) {
if(strpos($key,$sk)){ return cerr($key,'403'); }
}
if(strpos($key,'proj}')){
$fp = str_replace('{proj}', DIR_PROJ, $key);
}else{
$fp = DIR_VIEWS."/$key";
}
if(file_exists("$fp-cdemo")){ return cerr($key,'403'); }
$data = comFiles::get($fp); if(!$data){ return cerr($key,'404'); }
return highlight_string($data,1);
}
function cerr($key, $code='404'){
$msg = glbHtml::httpStatus($code, 1);
return "`$key` $msg";
}
/*
$files = [
'cfg_adbug.php', 'cfg_db.php',
];
*/
-End-