1 system.updater.inc public LayoutUpdater::getInstallDirectory()

Return the directory where a layout should be installed.

If the layout is already installed, backdrop_get_path() will return a valid path and we should install it there (although we need to use an absolute path, so we prepend BACKDROP_ROOT). If we're installing a new layout, we always want it to go into /layouts, since that's where all the documentation recommends users install their layouts, and there's no way that can conflict on a multi-site installation, since the Update manager won't let you install a new layout if it's already found on your system, and if there was a copy in top-level, we'd see it.

Overrides BackdropUpdaterInterface::getInstallDirectory

File

core/modules/system/system.updater.inc, line 197
Subclasses of the Updater class to update Backdrop core, modules, themes, and layouts.

Class

LayoutUpdater
Class for updating layouts using FileTransfer classes via authorize.php.

Code

public function getInstallDirectory() {
  if ($relative_path = backdrop_get_path('layout', $this->name)) {
    $relative_path = dirname($relative_path);
  }
  elseif (file_exists(BACKDROP_ROOT . '/layouts/contrib')) {
    $relative_path = 'layouts/contrib';
  }
  else {
    $relative_path = 'layouts';
  }
  return realpath(BACKDROP_ROOT) . '/' . $relative_path;
}