Open Monograph Press  3.3.0
fixFilenames.php
1 <?php
2 
18 require(dirname(__FILE__) . '/bootstrap.inc.php');
19 
20 import('lib.pkp.classes.cliTool.CliTool');
21 
24  var $dryrun;
25 
30  function __construct($argv = array()) {
31  parent::__construct($argv);
32 
33  if (($arg = array_pop($this->argv)) == '--dry-run') {
34  $this->dryrun = true;
35  } elseif ($arg == '') {
36  $this->dryrun = false;
37  } else {
38  $this->usage();
39  exit();
40  }
41  }
42 
46  function usage() {
47  echo "Command-line tool for fixing potential incorrectly named files in OMP 1.0\n"
48  . "Usage:\n"
49  . "\t{$this->scriptName} [--dry-run]\n"
50  . "\t\tThe --dry-run option can be used to test without making changes.\n";
51  }
52 
56  function execute() {
57  import('classes.install.Upgrade');
58  Upgrade::fixFilenames($this->dryrun);
59  }
60 }
61 
62 $tool = new fixFilenames(isset($argv) ? $argv : array());
63 $tool->execute();
64 
65 
Upgrade\fixFilenames
fixFilenames($upgrade, $params, $dryrun=false)
Definition: Upgrade.inc.php:50
fixFilenames\$dryrun
$dryrun
Definition: fixFilenames.php:27
CommandLineTool
Initialization code for command-line scripts.
Definition: CliTool.inc.php:44
$tool
$tool
Definition: mergeCoverageReportTool.php:120
fixFilenames\__construct
__construct($argv=array())
Definition: fixFilenames.php:33
fixFilenames
CLI tool to fix pre-1.0 filenames that may have been incorrectly generated. See bug #8461.
Definition: fixFilenames.php:22
fixFilenames\usage
usage()
Definition: fixFilenames.php:49
fixFilenames\execute
execute()
Definition: fixFilenames.php:59
CommandLineTool\$argv
$argv
Definition: CliTool.inc.php:53