mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-25 05:22:59 +00:00
Added <?php ?> tags to and added code to remove them to
This commit is contained in:
parent
ea2411aa67
commit
646591fa90
3 changed files with 115 additions and 102 deletions
11
build.php
11
build.php
|
@ -10,8 +10,17 @@ function logstr($str, $newline = true, $showtime = true)
|
||||||
echo("\n");
|
echo("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeouterphptags($phpcode)
|
||||||
|
{
|
||||||
|
$firstindex = strpos($phpcode, "\n", strpos($phpcode, "<?php"));
|
||||||
|
$lastindex = strrpos($phpcode, "?>");
|
||||||
|
|
||||||
|
return substr($phpcode, $firstindex, $lastindex - $firstindex);
|
||||||
|
}
|
||||||
|
|
||||||
header("content-type: text/plain");
|
header("content-type: text/plain");
|
||||||
|
|
||||||
|
// Protects against users wiping the settings if run via CGI
|
||||||
logstr("Checking for existing build....", false);
|
logstr("Checking for existing build....", false);
|
||||||
if(file_exists("index.php"))
|
if(file_exists("index.php"))
|
||||||
{
|
{
|
||||||
|
@ -28,7 +37,7 @@ logstr("Reading `core.php`...", false);
|
||||||
$build = file_get_contents("core.php");
|
$build = file_get_contents("core.php");
|
||||||
logstr("done", true, false);
|
logstr("done", true, false);
|
||||||
logstr("Reading `settings.fragment.php`...", false);
|
logstr("Reading `settings.fragment.php`...", false);
|
||||||
$settings = file_get_contents("settings.fragment.php");
|
$settings = removeouterphptags(file_get_contents("settings.fragment.php"));
|
||||||
logstr("done", true, false);
|
logstr("done", true, false);
|
||||||
|
|
||||||
logstr("Building.....", false);
|
logstr("Building.....", false);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
$start_time = time(true);
|
$start_time = time(true);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pepperminty Wiki
|
* Pepperminty Wiki
|
||||||
* ================
|
* ================
|
||||||
|
@ -102,6 +103,7 @@ Actions:
|
||||||
credits - view the credits
|
credits - view the credits
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
/////////////// Do not edit below this line unless you know what you are doing! ///////////////
|
/////////////// Do not edit below this line unless you know what you are doing! ///////////////
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<?php
|
||||||
/*
|
/*
|
||||||
* Pepperminty Wiki
|
* Pepperminty Wiki
|
||||||
* ================
|
* ================
|
||||||
|
@ -98,3 +99,4 @@ Actions:
|
||||||
help - get help
|
help - get help
|
||||||
credits - view the credits
|
credits - view the credits
|
||||||
*/
|
*/
|
||||||
|
?>
|
||||||
|
|
Loading…
Reference in a new issue