public static function ModuleUpdater::canUpdateDirectory

Determine if the Updater can handle the project provided in $directory.

@todo: Provide something more rational here, like a project spec file.

Parameters

string $directory:

Return value

bool TRUE if the project is installed, FALSE if not.

Overrides DrupalUpdaterInterface::canUpdateDirectory

Archivo

drupal-7.x/modules/system/system.updater.inc, line 40
Subclasses of the Updater class to update Drupal core knows how to update. At this time, only modules and themes are supported.

Class

ModuleUpdater
Class for updating modules using FileTransfer classes via authorize.php.

Código

public static function canUpdateDirectory($directory) {
  if (file_scan_directory($directory, '/.*\.module$/')) {
    return TRUE;
  }
  return FALSE;
}