static function ThemeUpdater::canUpdateDirectory

static ThemeUpdater::canUpdateDirectory($directory)

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

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

Class

ThemeUpdater
Class for updating themes using FileTransfer classes via authorize.php.

Code

static function canUpdateDirectory($directory) {
  // This is a lousy test, but don't know how else to confirm it is a theme.
  if (file_scan_directory($directory, '/.*\.module$/')) {
    return FALSE;
  }
  return TRUE;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.updater.inc/function/ThemeUpdater::canUpdateDirectory/7.x