You are here

public function MigrateItemFile::__construct in Migrate 6.2

Same name and namespace in other branches
  1. 7.2 plugins/sources/files.inc \MigrateItemFile::__construct()

Constructor.

Parameters

$base_dir: The base directory from which all file paths are calculated.

$get_contents: TRUE if we should try load the contents of each file (in the case of a text file), or FALSE if we just want to confirm it exists (binary).

Overrides MigrateItem::__construct

File

plugins/sources/files.inc, line 187
Support for migration from files sources.

Class

MigrateItemFile
Implementation of MigrateItem, for retrieving a file from the file system based on source directory and an ID provided by a MigrateList class.

Code

public function __construct($base_dir, $get_contents = TRUE, MigrateContentParser $parser = NULL) {
  parent::__construct();
  if (!$parser) {
    $parser = new MigrateSimpleContentParser();
  }
  $this->baseDir = $base_dir;
  $this->getContents = $get_contents;
  $this->parser = $parser;
}