[J1.5] Problem with is_dir

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
KlausM
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Feb 22, 2008 4:24 pm
Location: Germany

[J1.5] Problem with is_dir

Post by KlausM » Fri Feb 22, 2008 4:32 pm

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?

User avatar
KlausM
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Feb 22, 2008 4:24 pm
Location: Germany

Re: [J1.5] Problem with is_dir

Post by KlausM » Fri Feb 22, 2008 7:04 pm

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?


Post Reply