| 46 | | // Set PLOGGER_EMBEDDED to 1 in config file to overrule automatic test |
| 47 | | // in case Plogger inclusion in different folder location, but doesn't already use mod_rewrite paths |
| 48 | | if ((PLOGGER_EMBEDDED == '1') || (dirname(__FILE__) != dirname(realpath($_SERVER['SCRIPT_FILENAME'])) && strpos($_SERVER['SCRIPT_FILENAME'],"admin") === false)) { |
| 49 | | $config["embedded"] = 1; |
| 50 | | // disable our own cruft-free urls, because the URL has already been processed |
| 51 | | // by WordPress |
| 52 | | $config["use_mod_rewrite"] = 0; |
| 53 | | trace('Plogger is embedded'); |
| 54 | | trace('dirname: ' . dirname(__FILE__)); |
| 55 | | trace('$_SERVER[\'SCRIPT_FILENAME\']' .': '. $_SERVER['SCRIPT_FILENAME']); |
| 56 | | trace('realpath($_SERVER[\'SCRIPT_FILENAME\'])' .': '. realpath($_SERVER['SCRIPT_FILENAME'])); |
| 57 | | } else { |
| 58 | | $config["embedded"] = 0; |
| 59 | | $config["baseurl"] = "http://".$_SERVER["HTTP_HOST"]. substr($_SERVER["PHP_SELF"],0,strrpos($_SERVER["PHP_SELF"],"/")) . "/"; |
| | 46 | if (!defined('PLOGGER_EMBEDDED') || PLOGGER_EMBEDDED=='') { |
| | 47 | if (dirname(__FILE__) != dirname(realpath($_SERVER['SCRIPT_FILENAME'])) && strpos($_SERVER['SCRIPT_FILENAME'],"admin") === false) { |
| | 48 | $config["embedded"] = 1; |
| | 49 | // disable our own cruft-free urls, because the URL has already been processed |
| | 50 | // by WordPress |
| | 51 | $config["use_mod_rewrite"] = 0; |
| | 52 | trace('Plogger is embedded'); |
| | 53 | trace('dirname: ' . dirname(__FILE__)); |
| | 54 | trace('$_SERVER[\'SCRIPT_FILENAME\']' .': '. $_SERVER['SCRIPT_FILENAME']); |
| | 55 | trace('realpath($_SERVER[\'SCRIPT_FILENAME\'])' .': '. realpath($_SERVER['SCRIPT_FILENAME'])); |
| | 56 | } else { |
| | 57 | $config["embedded"] = 0; |
| | 58 | $config["baseurl"] = "http://".$_SERVER["HTTP_HOST"]. substr($_SERVER["PHP_SELF"],0,strrpos($_SERVER["PHP_SELF"],"/")) . "/"; |
| | 59 | } |
| | 60 | } else{ |
| | 61 | // Set PLOGGER_EMBEDDED to 1 in config file to overrule automatic test |
| | 62 | if (PLOGGER_EMBEDDED == '1') { |
| | 63 | $config["embedded"] = 1; |
| | 64 | $config["use_mod_rewrite"] = 0; |
| | 65 | trace('Plogger is embedded'); |
| | 66 | // Set PLOGGER_EMBEDDED to 0 in case Plogger inclusion in different folder location, but does not already use mod_rewrite paths |
| | 67 | } else { |
| | 68 | $config["embedded"] = 0; |
| | 69 | $config["baseurl"] = "http://".$_SERVER["HTTP_HOST"]. substr($_SERVER["PHP_SELF"],0,strrpos($_SERVER["PHP_SELF"],"/")) . "/"; |
| | 70 | } |