function mailsystem_get_classes in Mail System 6
Same name and namespace in other branches
- 8 mailsystem.admin.inc \mailsystem_get_classes()
- 8.2 mailsystem.module \mailsystem_get_classes()
- 6.2 mailsystem.module \mailsystem_get_classes()
- 7.3 mailsystem.module \mailsystem_get_classes()
- 7 mailsystem.admin.inc \mailsystem_get_classes()
- 7.2 mailsystem.module \mailsystem_get_classes()
Returns a list of classes which implement MailSystemInterface.
1 call to mailsystem_get_classes()
- mailsystem_admin_settings in ./
mailsystem.admin.inc - @file Administrative form for setting the mail_system variable.
File
- ./
mailsystem.admin.inc, line 127 - Administrative form for setting the mail_system variable.
Code
function &mailsystem_get_classes(array $mail_system) {
static $mailsystem_classes = NULL;
if (!isset($mailsystem_classes)) {
// Start with the default, at least.
$mailsystem_classes = array(
mailsystem_default_value() => mailsystem_default_value(),
);
foreach (get_declared_classes() as $classname) {
// Assuming SPL is available, since drupal uses it to autoload classes.
if (in_array('MailSystemInterface', class_implements($classname), TRUE)) {
$mailsystem_classes[$classname] = $classname;
}
}
foreach (array_unique(array_values($mail_system)) as $classname) {
if ($classname && is_string($classname)) {
$mailsystem_classes[$classname] = $classname;
}
}
ksort($mailsystem_classes);
}
return $mailsystem_classes;
}