You are here

protected static function AutomaticUpdatesPsa::isValidExtension in Automatic Updates 7

Determine if extension exists and has a version string.

Parameters

string $extension_type: The extension type i.e. module, theme.

string $project_name: The project.

Return value

bool TRUE if extension exists, else FALSE.

1 call to AutomaticUpdatesPsa::isValidExtension()
AutomaticUpdatesPsa::getPublicServiceMessages in ./AutomaticUpdatesPsa.php

File

./AutomaticUpdatesPsa.php, line 133
Contains AutomaticUpdatesPsa class.

Class

AutomaticUpdatesPsa
Class AutomaticUpdatesPsa.

Code

protected static function isValidExtension($extension_type, $project_name) {
  $extension_path = @drupal_get_path($extension_type, $project_name);
  if ($extension_path && ($info = drupal_parse_info_file($extension_path . DIRECTORY_SEPARATOR . $project_name . '.info'))) {
    return isset($info['version']);
  }
  return FALSE;
}