Differential D14463 Diff 35378 src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementRenamespaceWorkflow.php
| Show All 24 Lines | $this | ||||
| array( | array( | ||||
| 'name' => 'to', | 'name' => 'to', | ||||
| 'param' => 'namespace', | 'param' => 'namespace', | ||||
| 'help' => pht('Desired database namespace for output.'), | 'help' => pht('Desired database namespace for output.'), | ||||
| ), | ), | ||||
| )); | )); | ||||
| } | } | ||||
| public function execute(PhutilArgumentParser $args) { | public function didExecute(PhutilArgumentParser $args) { | ||||
| $console = PhutilConsole::getConsole(); | $console = PhutilConsole::getConsole(); | ||||
| $in = $args->getArg('in'); | $in = $args->getArg('in'); | ||||
| if (!strlen($in)) { | if (!strlen($in)) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht('Specify the dumpfile to read with --in.')); | pht( | ||||
| 'Specify the dumpfile to read with %s.', | |||||
| '--in')); | |||||
| } | } | ||||
| $from = $args->getArg('from'); | $from = $args->getArg('from'); | ||||
| if (!strlen($from)) { | if (!strlen($from)) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht('Specify namespace to rename from with --from.')); | pht( | ||||
| 'Specify namespace to rename from with %s.', | |||||
| '--from')); | |||||
| } | } | ||||
| $to = $args->getArg('to'); | $to = $args->getArg('to'); | ||||
| if (!strlen($to)) { | if (!strlen($to)) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht('Specify namespace to rename to with --to.')); | pht( | ||||
| 'Specify namespace to rename to with %s.', | |||||
| '--to')); | |||||
| } | } | ||||
| $patterns = array( | $patterns = array( | ||||
| 'use' => '@^(USE `)([^_]+)(_.*)$@', | 'use' => '@^(USE `)([^_]+)(_.*)$@', | ||||
| 'create' => '@^(CREATE DATABASE /\*.*?\*/ `)([^_]+)(_.*)$@', | 'create' => '@^(CREATE DATABASE /\*.*?\*/ `)([^_]+)(_.*)$@', | ||||
| ); | ); | ||||
| $found = array_fill_keys(array_keys($patterns), 0); | $found = array_fill_keys(array_keys($patterns), 0); | ||||
| Show All 35 Lines | |||||