You are here

public static function LibraryUpdater::canUpdateDirectory in Apps 7

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

File

./apps.updater.inc, line 16
Provides the LibraryUpdater class.

Class

LibraryUpdater
@file Provides the LibraryUpdater class.

Code

public static function canUpdateDirectory($directory) {
  if ($info = file_scan_directory($directory, '/.*\\.info$/')) {

    // Allow apps.info as it contains our app information.
    foreach ($info as $file_path => $file_info) {
      if ($file_info->filename != APPS_APP_INFO) {
        return FALSE;
      }
    }
  }
  return TRUE;
}