src/OaiPmh/HarvesterConsoleRunner.php
public function run()
    {
        // Support help message:
        if ($this->opts->getOption('h')) {
            $this->getHelp();
            return true;
        }

        if (!$allSettings = $this->getSettings()) {
            return false;
        }

        // Loop through all the settings and perform harvests:
        $processed = $skipped = 0;
        foreach ($allSettings as $target => $baseSettings) {
            $settings = $this->updateSettingsWithConsoleOptions($baseSettings);
            if (empty($target) || empty($settings)) {
                $skipped++;
                continue;
            }
            $this->writeLine("Processing {$target}...");
            try {
                $this->harvestSingleRepository($target, $settings);
            } catch (\Exception $e) {
                $this->writeLine($e->getMessage());
                return false;
            }
            $processed++;
        }

        // All done.
        if ($processed == 0 && $skipped > 0) {
            $this->writeLine(
                'No valid settings found; '
                . 'please set url and metadataPrefix at minimum.'
            );
            return false;
        }
        $this->writeLine(
            "Completed without errors -- {$processed} source(s) processed."
        );
        return true;
    }
public function run()
    {
        // Support help message:
        if ($this->opts->getOption('h')) {
            $this->getHelp();
            return true;
        }

        if (!$allSettings = $this->getSettings()) {
            return false;
        }

        // Loop through all the settings and perform harvests:
        $processed = $skipped = 0;
        foreach ($allSettings as $target => $baseSettings) {
            $settings = $this->updateSettingsWithConsoleOptions($baseSettings);
            if (empty($target) || empty($settings)) {
                $skipped++;
                continue;
            }
            $this->writeLine("Processing {$target}...");
            try {
                $this->harvestSingleRepository($target, $settings);
            } catch (\Exception $e) {
                $this->writeLine($e->getMessage());
                return false;
            }
            $processed++;
        }

        // All done.
        if ($processed == 0 && $skipped > 0) {
            $this->writeLine(
                'No valid settings found; '
                . 'please set url and metadataPrefix at minimum.'
            );
            return false;
        }
        $this->writeLine(
            "Completed without errors -- {$processed} source(s) processed."
        );
        return true;
    }
public function run ( ) { // Support help message: if ( $ this -> opts -> getOption ( 'h' ) ) { $ this -> getHelp ( ) ; return true ; } if ( ! $ allSettings = $ this -> getSettings ( ) ) { return false ; } // Loop through all the settings and perform harvests: $ processed = $ skipped = 0 ; foreach ( $ allSettings as $ target => $ baseSettings ) { $ settings = $ this -> updateSettingsWithConsoleOptions ( $ baseSettings ) ; if ( empty ( $ target ) || empty ( $ settings ) ) { $ skipped ++ ; continue ; } $ this -> writeLine ( "Processing {$target}..." ) ; try { $ this -> harvestSingleRepository ( $ target , $ settings ) ; } catch ( \ Exception $ e ) { $ this -> writeLine ( $ e -> getMessage ( ) ) ; return false ; } $ processed ++ ; } // All done. if ( $ processed == 0 && $ skipped > 0 ) { $ this -> writeLine ( 'No valid settings found; ' . 'please set url and metadataPrefix at minimum.' ) ; return false ; } $ this -> writeLine ( "Completed without errors -- {$processed} source(s) processed." ) ; return true ; }
Run the task and return true on success.

@return bool
Run the task and return true on success .