[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cpx] CPX progress update



Jonathan Linowes wrote:
I would also like to know if the problem I reported with interference with
namespace variables is in the bug database.

Yes, I am able to reproduce this problemn and have reported it in our bug database.

Here is a temporary work around you might consider if you are OK with changing the Xaraya source code. Around line 82 of the includes/xarServer.php file (in the lastest version of Xaraya), insert this line:

    if($name == 'PATH_INFO') return;

so that the xarServerGetVar function reads:

function xarServerGetVar($name)
{
assert('version_compare("4.1.2",phpversion()) <= 0; /* The minimum PHP version supported by Xaraya is 4.1.2 */');
    if (isset($_SERVER[$name])) {
        return $_SERVER[$name];
    }
    if($name == 'PATH_INFO') return;

    if (isset($_ENV[$name])) {
        return $_ENV[$name];
    }

    if ($val = getenv($name)) {
        return $val;
    }
    return; // we found nothing here
}

This will prevent Xaraya from looking in the environment for the PATH_INFO variable if it doesn't find it in PHP's $_SERVER array. The PATH_INFO should always be set correctly in the $_SERVER array in PHP so there should be no need to look for it in the environment.

Also if you are using an .htaccess file in your document root to be able to use short URLs without having to specify 'index.php', then to allow requests to CPX to not be caught by the RewriteRule, you will probably want to add the following line:

RewriteCond %{REQUEST_FILENAME} !/ControlPanel

so that the .htaccess file reads:

RewriteEngine on
# Send anything we can't find to Xaraya
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !/ControlPanel
RewriteRule ^(.+) index.php/$1 [L]

Let me know if you have any problems as I was able to get the above to work with CPX installed and a test Xaraya installation with short URLs enabled.


--
Jared Betteridge
======================================================================
This is <cpx@xxxxxxxxxxxxx>      <http://www.groupmail.org/lists/cpx/>
Before posting a question, please search the archives (see above URL).


Home | Main Index | Thread Index
Match: Format: Sort by:
Search: