$resp->notify('No tracking headers found.', 'This only tests for one specific header, and does not mean that another doesn\'t exist'); } break; case 'git_command': require_login('admin'); if (array_key_exists('prompt_value', $_POST) and strlen($_POST['prompt_value'])) { $command = 'git ' . escapeshellcmd($_POST['prompt_value']); $result = `{$command}`; $resp->notify($command, $result, 'images/logos/git.png'); } break; case 'recent_commits': $resp->remove('#recent_commits_dialog, .backdrop')->append('body', load_results('recent_commits'))->showModal('#recent_commits_dialog'); break; case 'github_issues': $resp->append('body', load_results('github_issues'))->showModal('#github_issues_dialog'); break; case 'README': $readme = new \shgysk8zer0\Core\File('README.md'); $parser = new \Parsedown\Parsedown(); $dialog = new \shgysk8zer0\Core\Elements\Dialog('README', $parser->text($readme)); $resp->append('body', $dialog)->showModal($dialog->id); break; case 'update_icons': require_login('admin'); $icons = \shgysk8zer0\Core\resources\Parser::parseFile('icons.json'); $found = array_filter(array_unique($icons->icons), 'file_exists'); if (count($found) === count($icons->icons)) { if (SVG_symbols($icons->icons, $icons->output)) { $resp->notify('Success!', "Icons have been saved to {$icons->output}"); } else {
if (!is_dir($input)) { echo "ERROR: is not a directory: '{$input}'\n"; exit; } else { if (file_exists($output)) { echo "ERROR: output file '{$output}' already exists\n"; exit; } } } /* query timeout limit */ define('QUERY_TIMEOUT', 300); echo "input directory: {$input}\n"; echo "output SQL file: {$output}\n\n"; // load the results from directory $data = load_results($input); // add information from the shell log parse_log($data, "{$input}/bench.log"); // write the results into SQL print_pgbench_sql($data, load_config("{$input}/pgbench.config"), $output); print_tpch_sql($data, load_config("{$input}/tpch.config"), $output); // build pgbench plots build_pgbench_plots($input, 'images', $data); /* FUNCTIONS */ /* loads results from the directories */ /* param $dir - directory with benchmark results */ function load_results($dir) { $data = array(); $fs_dir = opendir($dir); while ($fs = readdir($fs_dir)) {
<?php $resp = \shgysk8zer0\Core\JSON_Response::load(); switch ($_POST['load_form']) { case 'login': $resp->remove('main > :not(aside)')->prepend('main', load_results('forms/login')); break; case 'new_post': require_login('user'); $form = \shgysk8zer0\Core\Template::load('form'); $post = \shgysk8zer0\Core\Template::load('posts'); $post->title('Title')->tags('Keywords')->content('Article Content Here')->license(null)->comments(null); $form->name('new_post')->action(URL . '/')->method('post')->inputs("{$post}"); $form->inputs .= '<textarea name="description" id="description" placeholder="Description will appear in searches. 160 character limit" maxlength="160" required></textarea><br/>'; $resp->remove('main > :not(aside)')->prepend('main', "{$form}")->setAttributes(['article header details' => ['open' => true], 'article [itemprop="keywords"], article [itemprop="text"], article [itemprop="headline"]' => ['contenteditable' => 'true'], 'article [itemprop="text"]' => ['contextmenu' => 'wysiwyg_menu', 'data-input-name' => 'content', 'data-dropzone' => 'main'], 'article [itemprop="headline"]' => ['data-input-name' => 'title'], 'article [itemprop="keywords"]' => ['data-input-name' => 'keywords']]); break; case 'compose_email': require_login('admin'); $resp->prepend('body', load_results('forms/compose_email'))->showModal('#compose_email_dialog'); break; case 'php_errors': require_login('admin'); $resp->html('main', load_results("forms/php_errors")); break; } exit($resp);
<?php $resp = \shgysk8zer0\Core\JSON_Response::load(); switch ($_POST['load_menu']) { default: $resp->prepend('body', load_results("menus/{$_POST['load_menu']}")); } exit($resp);