$filename= "$CFG->themewww/accentuate/images/logo.jpg";
if (file_exists($filename)) {
I'm guessing that the problem is in the way I'm passing the $filename variable through file_exists. Any help is appreciated.
I'm trying to use file_exists to have Moodle check for a logo file in the theme folder. Unfortunately, it's not working. Here's what I have
file_exists expects a local file to be passed as the $filename parameter, so you'd need to be using $CFG->dirroot
Perfect! I knew it was simple. Thank you Paul.
$filename= "{$CFG->themewww}/accentuate/images/logo.jpg";
But properly you are trying to different things wrong also, file_exists does support URL wrappers, but properly you don't want to go through your webserv to see if a local file exists, do you?
hit helps if you tell us what you are trying to do.
Check how other extensions work, and if you need to check if a local file exists, then check it on your local filesystem and don't ask your webserver (unless you really know what you are doing in very special situations like replications).
Ries
But properly you are trying to different things wrong also, file_exists does support URL wrappers, but properly you don't want to go through your webserv to see if a local file exists, do you?
hit helps if you tell us what you are trying to do.
Check how other extensions work, and if you need to check if a local file exists, then check it on your local filesystem and don't ask your webserver (unless you really know what you are doing in very special situations like replications).
Ries