src/OaiPmh/HarvesterFactory.php
public function getHarvester($target, $harvestRoot, Client $client = null,
        array $settings = []
    ) {
        $basePath = $this->getBasePath($harvestRoot, $target);
        $responseProcessor = $this->getResponseProcessor($basePath, $settings);
        $communicator = $this->getCommunicator(
            $this->configureClient($client, $settings),
            $settings, $responseProcessor, $target
        );
        $formatter = $this->getFormatter($communicator, $settings);
        $strategy = $this->getWriterStrategyFactory()
            ->getStrategy($basePath, $settings);
        $writer = $this->getWriter($strategy, $formatter, $settings);
        $stateManager = $this->getStateManager($basePath);
        $harvester = new Harvester($communicator, $writer, $stateManager, $settings);
        if ($writer = $this->getConsoleWriter($settings)) {
            $harvester->setOutputWriter($writer);
        }
        return $harvester;
    }
public function getHarvester($target, $harvestRoot, Client $client = null,
        array $settings = []
    ) {
        $basePath = $this->getBasePath($harvestRoot, $target);
        $responseProcessor = $this->getResponseProcessor($basePath, $settings);
        $communicator = $this->getCommunicator(
            $this->configureClient($client, $settings),
            $settings, $responseProcessor, $target
        );
        $formatter = $this->getFormatter($communicator, $settings);
        $strategy = $this->getWriterStrategyFactory()
            ->getStrategy($basePath, $settings);
        $writer = $this->getWriter($strategy, $formatter, $settings);
        $stateManager = $this->getStateManager($basePath);
        $harvester = new Harvester($communicator, $writer, $stateManager, $settings);
        if ($writer = $this->getConsoleWriter($settings)) {
            $harvester->setOutputWriter($writer);
        }
        return $harvester;
    }
public function getHarvester ( $ target , $ harvestRoot , Client $ client = null , array $ settings = [ ] ) { $ basePath = $ this -> getBasePath ( $ harvestRoot , $ target ) ; $ responseProcessor = $ this -> getResponseProcessor ( $ basePath , $ settings ) ; $ communicator = $ this -> getCommunicator ( $ this -> configureClient ( $ client , $ settings ) , $ settings , $ responseProcessor , $ target ) ; $ formatter = $ this -> getFormatter ( $ communicator , $ settings ) ; $ strategy = $ this -> getWriterStrategyFactory ( ) -> getStrategy ( $ basePath , $ settings ) ; $ writer = $ this -> getWriter ( $ strategy , $ formatter , $ settings ) ; $ stateManager = $ this -> getStateManager ( $ basePath ) ; $ harvester = new Harvester ( $ communicator , $ writer , $ stateManager , $ settings ) ; if ( $ writer = $ this -> getConsoleWriter ( $ settings ) ) { $ harvester -> setOutputWriter ( $ writer ) ; } return $ harvester ; }
Get the harvester

@param string $target      Name of source being harvested (used as directory
name for storing harvested data inside $harvestRoot)
@param string $harvestRoot Root directory containing harvested data.
@param Client $client      HTTP client
@param array  $settings    Additional settings

@return Harvester

@throws \Exception
Get the harvester