For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > May 2004 > livedocs bug









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author livedocs bug
Nuno Lopes

2004-05-28, 5:32 pm

Hello,

Latest "improvements" on livedocs have broken it.

The problem is in handle_include(). It was modified so that it could solve
the problem with PCRE (for example).
However that implementation contains a bug. Let's see:

This 3 line long sql query never returns a result (at least on my machine):
list($row) = sqlite_array_query($GLOBALS['idx'], "SELECT idents.id, lvl
from ents left join files on ents.value = files.filename left join idents on
files.fileid = idents.fileid left join toc on ents.entid=toc.docbook_id
where is_file=1 and ents.entid='$ref' limit 1");

so, $lvl isn't set.


Then we have:
$filename = sqlite_single_query($GLOBALS['idx'], "SELECT value from ents
where entid='$ref' and is_file=1");

$path = PHPDOC . DIRECTORY_SEPARATOR . $filename;

if (!file_exists($path)) {
$path = PHPDOC . DIRECTORY_SEPARATOR . $GLOBALS['lang'] .
DIRECTORY_SEPARATOR . $filename;
}

The $filename returns for me the path to the file
('C:/cvs/phpdoc/en/reference/tidy/functions.xml' for example). So $path will
be:
C:\cvs\phpdoc\C:/cvs/phpdoc/en/reference/tidy/functions.xml. Why we need
that code to find the $path, when $path should be $filename?

So, the references pages aren't showing any functions.


Nuno
Ilia Alshanetsky

2004-05-28, 5:32 pm

I don't see this problem on *nix, could it be that it is win32 specific?

Ilia


On May 28, 2004 04:53 pm, you wrote:
> Hello,
>
> Latest "improvements" on livedocs have broken it.
>
> The problem is in handle_include(). It was modified so that it could solve
> the problem with PCRE (for example).
> However that implementation contains a bug. Let's see:
>
> This 3 line long sql query never returns a result (at least on my machine):
> list($row) = sqlite_array_query($GLOBALS['idx'], "SELECT idents.id, lvl
> from ents left join files on ents.value = files.filename left join idents
> on files.fileid = idents.fileid left join toc on ents.entid=toc.docbook_id
> where is_file=1 and ents.entid='$ref' limit 1");
>
> so, $lvl isn't set.
>
>
> Then we have:
> $filename = sqlite_single_query($GLOBALS['idx'], "SELECT value from ents
> where entid='$ref' and is_file=1");
>
> $path = PHPDOC . DIRECTORY_SEPARATOR . $filename;
>
> if (!file_exists($path)) {
> $path = PHPDOC . DIRECTORY_SEPARATOR . $GLOBALS['lang'] .
> DIRECTORY_SEPARATOR . $filename;
> }
>
> The $filename returns for me the path to the file
> ('C:/cvs/phpdoc/en/reference/tidy/functions.xml' for example). So $path
> will be:
> C:\cvs\phpdoc\C:/cvs/phpdoc/en/reference/tidy/functions.xml. Why we need
> that code to find the $path, when $path should be $filename?
>
> So, the references pages aren't showing any functions.
>
>
> Nuno

Nuno Lopes

2004-05-28, 6:34 pm

> I don't see this problem on *nix, could it be that it is win32 specific?
>
> Ilia



Maybe, I'm using windows...

There was already, a long time ago, a win specific problem because you were
mixing '/' and DIRECTORY_SEPARATOR. (but I think I've fix it).

If nobody fixes it, maybe tomorow I may take a look into this bug.

Nuno

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com