Reply to Re: PHP __FILE__ directive not functioning?

Your name:

Reply:


Posted by Dennis Kehrig on 04/17/07 19:06

Hello,

in such cases, search the files of the affected application for the
error message.

Searching for "your PHP __FILE__" reveals a lot of translation files,
but also the file install\steps\SystemChecksStep.class.

This file's first occurance of the search looks like this:
if (!SystemChecksStep::CheckFileDirective()) {
// ...
'notice' => _('Error: your PHP __FILE__ ...

In other words, the logic for checking the file directive is contained
in the CheckFileDirective method, which looks like this:

function CheckFileDirective() {
if (strstr(__FILE__, 'install/steps/SystemChecksStep.class') ||
strstr(__FILE__, '\\install\\steps\\SystemChecksStep.class')) {
return true;
} else {
return false;
}
}

So Gallery searches for the path to the current file with / as a
directory separator (Unix), then with a \ (Windows). If none of these
works, it assumes an error in the directive.

You mentioned that you're running OS/X. As far as I know, "::" is the
directory separator there, but I'm not sure. Try editing the mentioned
file to insert:

echo __FILE__."<br />";

and have a look at the output. Most likely this will reveal why Gallery
thinks, that the __FILE__ directive is broken. If a directory seperator
other than / or \ is the problem, you might try adding a line
corresponding to the actual separator. However, since other parts of
Gallery might rely on it being either / or \, you might cause other
problems.

Whatever the outcome, I'm curious as to what __FILE__ looks like on your
box.

Greetings,

Dennis Kehrig

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация