argv)) { $this->usage(); exit(1); } $this->parameters = $this->argv; } /** * Print command usage information. */ function usage() { echo "Permanently removes submission(s) and associated information. USE WITH CARE.\n" . "Usage: {$this->scriptName} submission_id [...]\n"; } /** * Delete submission data and associated files */ function execute() { $articleDao = DAORegistry::getDAO('ArticleDAO'); foreach($this->parameters as $articleId) { $article = $articleDao->getById($articleId); if(!isset($article)) { printf("Error: Skipping $articleId. Unknown submission.\n"); continue; } $articleDao->deleteById($articleId); } } } $tool = new SubmissionDeletionTool(isset($argv) ? $argv : array()); $tool->execute(); ?>