You are here: Re: [PHP] is_dir paths « PHP « IT news, forums, messages
Re: [PHP] is_dir paths

Posted by "Mark Rees" on 09/26/05 18:41

> echo '<pre>', var_dump( $_SERVER ), '</pre>';
>
> for instance I cut/paste the following from an application of my,
> the code lives in a centrally included file:
>
> /* define a webroot basepath for the datasyncer module */
> define('DS_WEBROOT', realpath(dirname(__FILE__).'/..'));
>

dirname! That's the easiest way.

$tmpdir=dirname(__FILE__)."\\temp";

Thanks for your help

> > The problem I have is that this path is set in the config section of a
3rd
> > party tool I'm using, and called from various pages within the site. I
don't
> > want to hack the code, as that will make upgrades more difficult to
apply.
> > Hard-coding the path from c: won't work well either, as that path is
> > different in the development and live environments.
>
> if the path is set in the third party tool whats the problem? sorry don't
mean to
> rude - I really don't quite follow the last part of your post!
>


No, it doesn't make much sense, does it? One more try: the 3rd party app has
a config script (config.php), where this path is set. It will be accessed
from scripts in various different directories, so the path needs to be
absolute. And therefore, it needs to be set dynamically so it can work on
different machines.

 

Navigation:

[Reply to this 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

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