Changeset 526

Show
Ignore:
Timestamp:
04/16/08 16:05:27 (7 months ago)
Author:
sidtheduck
Message:

+ took out too much of the PLOGGER_EMBEDDED conditionals in r523. Adding back code so override works correctly per Kasper's code.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/plog-load_config.php

    r523 r526  
    4444// Using $_SERVER['SCRIPT_FILENAME'] should produce the same result as __FILE__ if inclusion script in same location as Plogger 
    4545// in some environments (virtual hosts) $_SERVER['SCRIPT_FILENAME'] is not the correct absolute path, but realpath() seems to clear it up 
    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"],"/")) . "/"; 
     46if (!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        } 
    6071} 
    6172