Fix: check if directory exists

This commit is contained in:
Regis Houssin 2010-04-02 11:56:23 +00:00
parent 2e595643f5
commit 0ac656b218
2 changed files with 6 additions and 3 deletions

View File

@ -68,6 +68,9 @@ $i = 0;
foreach($interfaces->dir as $dir)
{
// Check if directory exists
if (!is_dir($dir)) continue;
$handle=opendir($dir);
while (($file = readdir($handle))!==false)

View File

@ -63,7 +63,7 @@ class Interfaces
dol_syslog('interface::run_triggers was called with wrong parameters object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf), LOG_WARNING);
}
// Load all directory
// Load the list of directories containing triggers
$this->getModulesTriggers();
foreach($this->dir as $dir)
@ -157,8 +157,8 @@ class Interfaces
}
/**
* \brief Return list of modules contains triggers.
* \return array List of module name.
* \brief Returns the list of directories containing triggers.
* \return array List of directories.
*/
function getModulesTriggers()
{