Page 1 of 1

[J1.5] Problem with is_dir

Posted: Fri Feb 22, 2008 4:32 pm
by KlausM
Hey,
i'm just starting programming with php and am trying to convert a plugin. i have a problem with is_dir. my code:

Code: Select all

$path = 'images/stories/fruit';
$fullpath = JURI::base() . $path."/";
if ( is_dir($fullpath))
{
     .....
}
else die ("Path is not a directory: " .$fullpath);
although my path exists i get the message "Path is not a directory: http://localhost/joomla/images/stories/fruit/"
:-\ can anybody please help me?

Re: [J1.5] Problem with is_dir

Posted: Fri Feb 22, 2008 7:04 pm
by KlausM
before 1.5 JURI::base() was $mosConfig_absolute_path; perhaps it's helpful to help me.
i tried some other things and came to

Code: Select all

JRequest::getString('joomla_directory');
which seems to work.
the JURI-thing returns the web-address (http://localhost...), this one returns the path (e.g. D:/...). Is this method correct or is there another one i should use?