plp050452 / simplesamlphp

Automatically exported from code.google.com/p/simplesamlphp
Other
0 stars 0 forks source link

Remove Assert from isModuleEnabled() #447

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm not sure why this assert is needed, it generates un-needed error log 
messages. The function will work properly with or without those default files.

Original issue reported on code.google.com by pan...@traileyes.com on 4 Nov 2011 at 3:22

Attachments:

GoogleCodeExporter commented 8 years ago
It is needed to make sure that all modules contain either a default-enable or 
default-disable file. (Those files are there to tell the user whether the 
module is enabled or disabled by default.)

Original comment by olavmrk@gmail.com on 7 Nov 2011 at 6:52

GoogleCodeExporter commented 8 years ago
Fair enough. Can I suggest making the error message a little more verbose? 
Changing the assert() to list the path, rather then the variable. Ex:

assert('file_exists("' . $moduleDir . '/default-disable") || file_exists("' . 
$moduleDir . '/default-enable")');

That way the exact module name is included in the logged error. I had to echo 
out the $moduleDir to figure it out on my own. Just a thought.

Original comment by pan...@traileyes.com on 11 Nov 2011 at 7:28