<?php use infrajs\nostore\Nostore; use infrajs\ans\Ans; if (!is_file('vendor/autoload.php')) { chdir('../../../'); require_once 'vendor/autoload.php'; } Nostore::pubStat(); $ports = Nostore::$conf['port']; $port = Ans::GET('port'); if (!$port) { return Ans::html('Требутеся параметр ?port=... возможные значения регистриуются в конфиге. <pre>' . print_r($ports, true) . '</pre>'); } if (empty($ports[$port])) { return Ans::html('Указанный port=' . $port . ' не зарегистрирован в конфиге. <pre>' . print_r($ports, true) . '</pre>'); } $text = file_get_contents($ports[$port]); return Ans::js($text);
use infrajs\rubrics\Rubrics; if (!is_file('vendor/autoload.php')) { chdir('../../../'); require_once 'vendor/autoload.php'; Router::init(); } $ans = array(); $src = Ans::GET('src'); if ($src) { if (!Path::isNest('~', $src)) { return Ans::err($ans, 'Передан некорректный или небезопасный путь'); } $id = Ans::GET('id'); $src = Rubrics::find($src, $id); $text = Rubrics::article($src); return Ans::html($text); } $conf = Config::get('rubrics'); $type = Path::toutf($_GET['type']); /* type два смысла.. type blog - имя рубрики и type list то как отображается всё */ if (empty($conf['list'][$type])) { return Ans::err($ans, 'Undefined type ' . $type); } $dir = '~' . $type . '/'; $ans['type'] = $conf['list'][$type]; if (in_array($conf['list'][$type]['type'], array('list', 'info'))) { $exts = array('docx', 'tpl', 'mht', 'html', 'php'); } else { $exts = array();