1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00
Pepperminty-Wiki/modules/action-raw.php

22 lines
515 B
PHP
Raw Normal View History

2015-09-21 17:04:51 +00:00
<?php
register_module([
"name" => "Raw page source",
"version" => "0.4",
2015-09-21 17:04:51 +00:00
"author" => "Starbeamrainbowlabs",
"description" => "Adds a 'raw' action that shows you the raw source of a page.",
"id" => "action-raw",
"code" => function() {
add_action("raw", function() {
global $env;
2015-09-21 17:04:51 +00:00
http_response_code(307);
header("x-filename: " . rawurlencode($env->page) . ".md");
2015-09-21 17:04:51 +00:00
header("content-type: text/markdown");
exit(file_get_contents("$env->storage_prefix$env->page.md"));
2015-09-21 17:04:51 +00:00
exit();
});
}
]);
?>