Skip to content

Instantly share code, notes, and snippets.

@cs278
Created February 11, 2010 13:43
Show Gist options
  • Save cs278/301512 to your computer and use it in GitHub Desktop.
Save cs278/301512 to your computer and use it in GitHub Desktop.
<?php
/**
* Debug phpBB installation path detections
*/
define('IN_PHPBB', true);
$phpEx = substr(strrchr(__FILE__, '.'), 1);
$phpbb_root_path = (strpos(__FILE__, 'adm/') !== false) ? './../' : './';
include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin();
header('Content-type: text/plain');
foreach (array('PHP_SELF', 'QUERY_STRING', 'REQUEST_URI') as $var)
{
echo "$var: ";
if (isset($_SERVER[$var]))
{
var_dump($_SERVER[$var]);
}
else if (getenv($var))
{
var_dump(getenv($var));
}
else
{
echo "unset";
}
echo "\n";
}
echo 'realpath(): ', realpath('./'), "\n";
echo 'phpbb_realpath(): ', phpbb_realpath('./'), "\n";
echo 'generate_board_url(): ', generate_board_url(), "\n";
var_dump(session::extract_current_page($phpbb_root_path));
garbage_collection();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment