HarvesterCommand

Extends \Symfony\Component\Console\Command\Command

OAI-PMH Harvest Tool (Symfony Console Command)

category

VuFind

package

Harvest_Tools

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Methods

Constructor

__construct(\Laminas\Http\Client $client = null, string $harvestRoot = null, \VuFindHarvest\OaiPmh\HarvesterFactory $factory = null, boolean $silent = false, string|null $name = null) 

Arguments

$client

\Laminas\Http\Client

HTTP client (omit for default)

$harvestRoot

string

Root directory for harvesting (omit for default)

$factory

\VuFindHarvest\OaiPmh\HarvesterFactory

Harvester factory (omit for default)

$silent

boolean

Should we suppress output?

$name

string|null

The name of the command; passing null means it must be set in configure()

Configure the command.

configure() : void

Run the command.

execute(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output) : integer

Arguments

$input

\Symfony\Component\Console\Input\InputInterface

Input object

$output

\Symfony\Component\Console\Output\OutputInterface

Output object

Response

integer

0 for success

Get the target directory for writing harvested files.

getHarvestRoot() : string

Response

string

Get an HTTP client.

getHttpClient() : \Laminas\Http\Client

Response

\Laminas\Http\Client

Load the harvest settings. Return false on error.

getSettings(\Symfony\Component\Console\Input\InputInterface $input) : array|boolean

Arguments

$input

\Symfony\Component\Console\Input\InputInterface

Input object

Response

array|boolean

Load configuration from an .ini file (or return false on error)

getSettingsFromIni(string $ini, string|boolean $section) : array|boolean

Arguments

$ini

string

Configuration file to load

$section

string|boolean

Section of .ini to load (or false for all)

Response

array|boolean

Harvest a single repository.

harvestSingleRepository(\Symfony\Component\Console\Input\InputInterface $input, \Symfony\Component\Console\Output\OutputInterface $output, string $target, array $settings) : void
Throws
\Exception

Arguments

$input

\Symfony\Component\Console\Input\InputInterface

Input object

$output

\Symfony\Component\Console\Output\OutputInterface

Output object

$target

string

Name of repo (used for target directory)

$settings

array

Settings for the harvester.

Set an object to accept console output messages.

setOutputWriter(\VuFindHarvest\ConsoleOutput\WriterInterface $writer) : void
inherited

Arguments

Use command-line switches to add/override settings found in the .ini file, if necessary.

updateSettingsWithConsoleOptions(\Symfony\Component\Console\Input\InputInterface $input, array $settings) : array

Arguments

$input

\Symfony\Component\Console\Input\InputInterface

Input object

$settings

array

Incoming settings

Response

array

Write a string to the console output writer (if set).

write(string $str) : void
inherited

Arguments

$str

string

String to write.

Write a string w/newline to the console output writer (if set).

writeLine(string $str) : void
inherited

Arguments

$str

string

String to write.

Properties

The name of the command

defaultName : string
static
var

Type(s)

string

HTTP client

client : \Laminas\Http\Client
var

Type(s)

\Laminas\Http\Client

Root directory for harvesting

harvestRoot : string
var

Type(s)

string

Harvester factory

factory : \VuFindHarvest\OaiPmh\HarvesterFactory
var

Type(s)

\VuFindHarvest\OaiPmh\HarvesterFactory

Silent mode

silent : boolean
var

Type(s)

boolean

Writer helper

outputWriter : \VuFindHarvest\ConsoleOutput\WriterInterface
inherited