You are here

public function ConfigHandler::getPatchFile in Update helper 8

Same name and namespace in other branches
  1. 2.x src/ConfigHandler.php \Drupal\update_helper\ConfigHandler::getPatchFile()

Get full path for update patch file.

Parameters

string $module_name: Module name.

string $update_name: Update name.

bool $create_directory: Flag if directory should be created.

Return value

string Returns full path file name for update patch.

1 call to ConfigHandler::getPatchFile()
ConfigHandler::loadUpdate in src/ConfigHandler.php
Load update definition from file.

File

src/ConfigHandler.php, line 379

Class

ConfigHandler
Configuration handler.

Namespace

Drupal\update_helper

Code

public function getPatchFile($module_name, $update_name, $create_directory = FALSE) {
  $update_dir = $this->moduleHandler
    ->getModule($module_name)
    ->getPath() . $this->baseUpdatePath;

  // Ensure that directory exists.
  if (!is_dir($update_dir) && $create_directory) {
    mkdir($update_dir, 0755, TRUE);
  }
  return $update_dir . '/' . $update_name . '.' . $this->serializer
    ->getFileExtension();
}