PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_Template_Xipe » Bug #2219

Problems with case of file/dir names

Details

Submitted2004-08-26 14:00 UTC
Fromesm at baseclass dot modulweb dot dk
StatusSuspended
PackageHTML_Template_Xipe
PHP Version4.3.8
OSIIS/Win2K
Roadmaps(Not assigned)

Comments

[2004-08-26 14:00 UTC] esm at baseclass dot modulweb dot dk

Description:
------------
When using PHP under IIS, file and path names are returned with their original case preserved. Apparently this is not the case under Apache where file names are converted to lowercase.

In function _methodWrapper (file: Xipe.php) you've written the following:

if (OS_WINDOWS) {
$filename = strtolower($filename);
$templateDir = strtolower($templateDir);
}

This makes it work under Apache (I presume :) ) but it makes it fail under IIS.

I suppose if there was a way to say:

if (OS_WINDOWS && APACHE) {
$filename = strtolower($filename);
$templateDir = strtolower($templateDir);
}

That would be the solution.

I fixed it by changing two functions:

_getCompiledFilePrefix in Main.php

From:
if( strpos( $this->getOption('compileDir') , $_SERVER['DOCUMENT_ROOT'] )!==0 )
{
etc....

To:

if(OS_WINDOWS)
$documentRoot = strtolower($_SERVER['DOCUMENT_ROOT']);
else
$documentRoot = $_SERVER['DOCUMENT_ROOT'];

if( strpos( $this->getOption('compileDir') , $documentRoot )!==0 )
{

And in setOption in options.php I inserted:

if (OS_WINDOWS && ($option == 'templateDir' || $option == 'cacheDir' ||$option == 'compileDir'))
$value = strtolower($value);