Beispiel #1
0
                unset($archive);
            }
        } else {
            if ($this->firstParam == '' || $this->firstParam === 'help' || $this->firstParam === 'usage') {
                $this->usage();
                return true;
            }
            // No archive was specified or the specified ID was invalid.
            // Display a list of archives.
            $archiveDao =& DAORegistry::getDAO('ArchiveDAO');
            $recordDao =& DAORegistry::getDAO('RecordDAO');
            $archives =& $archiveDao->getArchives();
            echo "Archive List\n";
            echo "------------\n";
            while ($archive =& $archives->next()) {
                $recordCount = $recordDao->getRecordCount($archive->getArchiveId());
                echo $archive->getArchiveId() . ': ' . $archive->getTitle() . " ({$recordCount} records)\n";
                unset($archive);
            }
            return false;
        }
        return !$hadErrors;
    }
    function statusCallback($message)
    {
        echo "{$message}\n";
    }
}
$tool = new harvest(isset($argv) ? $argv : array());
$tool->execute();