1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18:
19:
20: App::uses('AppShell', 'Console/Command');
21: App::uses('Folder', 'Utility');
22:
23: 24: 25: 26: 27:
28: class UpgradeShell extends AppShell {
29:
30: 31: 32: 33: 34:
35: protected $_files = array();
36:
37: 38: 39: 40: 41:
42: protected $_paths = array();
43:
44: 45: 46: 47: 48:
49: protected $_map = array(
50: 'Controller' => 'Controller',
51: 'Component' => 'Controller/Component',
52: 'Model' => 'Model',
53: 'Behavior' => 'Model/Behavior',
54: 'Datasource' => 'Model/Datasource',
55: 'Dbo' => 'Model/Datasource/Database',
56: 'View' => 'View',
57: 'Helper' => 'View/Helper',
58: 'Shell' => 'Console/Command',
59: 'Task' => 'Console/Command/Task',
60: 'Case' => 'Test/Case',
61: 'Fixture' => 'Test/Fixture',
62: 'Error' => 'Lib/Error',
63: );
64:
65: 66: 67: 68: 69:
70: public function startup() {
71: parent::startup();
72: if ($this->params['dry-run']) {
73: $this->out(__d('cake_console', '<warning>Dry-run mode enabled!</warning>'), 1, Shell::QUIET);
74: }
75: if ($this->params['git'] && !is_dir('.git')) {
76: $this->out(__d('cake_console', '<warning>No git repository detected!</warning>'), 1, Shell::QUIET);
77: }
78: }
79:
80: 81: 82: 83: 84:
85: public function all() {
86: foreach ($this->OptionParser->subcommands() as $command) {
87: $name = $command->name();
88: if ($name === 'all') {
89: continue;
90: }
91: $this->out(__d('cake_console', 'Running %s', $name));
92: $this->$name();
93: }
94: }
95:
96: 97: 98: 99: 100: 101: 102:
103: public function tests() {
104: $this->_paths = array(APP . 'tests' . DS);
105: if (!empty($this->params['plugin'])) {
106: $this->_paths = array(App::pluginPath($this->params['plugin']) . 'tests' . DS);
107: }
108: $patterns = array(
109: array(
110: '*TestCase extends CakeTestCase to *Test extends CakeTestCase',
111: '/([a-zA-Z]*Test)Case extends CakeTestCase/',
112: '\1 extends CakeTestCase'
113: ),
114: );
115:
116: $this->_filesRegexpUpdate($patterns);
117: }
118:
119: 120: 121: 122: 123: 124: 125: 126: 127:
128: public function locations() {
129: $cwd = getcwd();
130:
131: if (!empty($this->params['plugin'])) {
132: chdir(App::pluginPath($this->params['plugin']));
133: }
134:
135: if (is_dir('plugins')) {
136: $Folder = new Folder('plugins');
137: list($plugins) = $Folder->read();
138: foreach ($plugins as $plugin) {
139: chdir($cwd . DS . 'plugins' . DS . $plugin);
140: $this->locations();
141: }
142: $this->_files = array();
143: chdir($cwd);
144: }
145: $moves = array(
146: 'config' => 'Config',
147: 'Config' . DS . 'schema' => 'Config' . DS . 'Schema',
148: 'libs' => 'Lib',
149: 'tests' => 'Test',
150: 'views' => 'View',
151: 'models' => 'Model',
152: 'Model' . DS . 'behaviors' => 'Model' . DS . 'Behavior',
153: 'Model' . DS . 'datasources' => 'Model' . DS . 'Datasource',
154: 'Test' . DS . 'cases' => 'Test' . DS . 'Case',
155: 'Test' . DS . 'fixtures' => 'Test' . DS . 'Fixture',
156: 'vendors' . DS . 'shells' . DS . 'templates' => 'Console' . DS . 'Templates',
157: );
158: foreach ($moves as $old => $new) {
159: if (is_dir($old)) {
160: $this->out(__d('cake_console', 'Moving %s to %s', $old, $new));
161: if (!$this->params['dry-run']) {
162: if ($this->params['git']) {
163: exec('git mv -f ' . escapeshellarg($old) . ' ' . escapeshellarg($old . '__'));
164: exec('git mv -f ' . escapeshellarg($old . '__') . ' ' . escapeshellarg($new));
165: } else {
166: $Folder = new Folder($old);
167: $Folder->move($new);
168: }
169: }
170: }
171: }
172:
173: $this->_moveViewFiles();
174: $this->_moveAppClasses();
175:
176: $sourceDirs = array(
177: '.' => array('recursive' => false),
178: 'Console',
179: 'controllers',
180: 'Controller',
181: 'Lib' => array('checkFolder' => false),
182: 'models',
183: 'Model',
184: 'tests',
185: 'Test' => array('regex' => '@class (\S*Test) extends CakeTestCase@'),
186: 'views',
187: 'View',
188: 'vendors/shells',
189: );
190:
191: $defaultOptions = array(
192: 'recursive' => true,
193: 'checkFolder' => true,
194: 'regex' => '@class (\S*) .*{@i'
195: );
196: foreach ($sourceDirs as $dir => $options) {
197: if (is_numeric($dir)) {
198: $dir = $options;
199: $options = array();
200: }
201: $options = array_merge($defaultOptions, $options);
202: $this->_movePhpFiles($dir, $options);
203: }
204: }
205:
206: 207: 208: 209: 210: 211: 212:
213: public function helpers() {
214: $this->_paths = array_diff(App::path('views'), App::core('views'));
215:
216: if (!empty($this->params['plugin'])) {
217: $this->_paths = array(App::pluginPath($this->params['plugin']) . 'views' . DS);
218: }
219:
220: $patterns = array();
221: App::build(array(
222: 'View/Helper' => App::core('View/Helper'),
223: ), App::APPEND);
224: $helpers = App::objects('helper');
225: $plugins = App::objects('plugin');
226: $pluginHelpers = array();
227: foreach ($plugins as $plugin) {
228: CakePlugin::load($plugin);
229: $pluginHelpers = array_merge(
230: $pluginHelpers,
231: App::objects('helper', App::pluginPath($plugin) . DS . 'views' . DS . 'helpers' . DS, false)
232: );
233: }
234: $helpers = array_merge($pluginHelpers, $helpers);
235: foreach ($helpers as $helper) {
236: $helper = preg_replace('/Helper$/', '', $helper);
237: $oldHelper = strtolower(substr($helper, 0, 1)).substr($helper, 1);
238: $patterns[] = array(
239: "\${$oldHelper} to \$this->{$helper}",
240: "/\\\${$oldHelper}->/",
241: "\\\$this->{$helper}->"
242: );
243: }
244:
245: $this->_filesRegexpUpdate($patterns);
246: }
247:
248: 249: 250: 251: 252: 253: 254: 255:
256: public function i18n() {
257: $this->_paths = array(
258: APP
259: );
260: if (!empty($this->params['plugin'])) {
261: $this->_paths = array(App::pluginPath($this->params['plugin']));
262: }
263:
264: $patterns = array(
265: array(
266: '<?php __*(*) to <?php echo __*(*)',
267: '/<\?php\s*(__[a-z]*\(.*?\))/',
268: '<?php echo \1'
269: ),
270: array(
271: '<?php __*(*, true) to <?php echo __*()',
272: '/<\?php\s*(__[a-z]*\(.*?)(,\s*true)(\))/',
273: '<?php echo \1\3'
274: ),
275: array('__*(*, true) to __*(*)', '/(__[a-z]*\(.*?)(,\s*true)(\))/', '\1\3')
276: );
277:
278: $this->_filesRegexpUpdate($patterns);
279: }
280:
281: 282: 283: 284: 285: 286: 287: 288: 289: 290: 291: 292: 293: 294:
295: public function basics() {
296: $this->_paths = array(
297: APP
298: );
299: if (!empty($this->params['plugin'])) {
300: $this->_paths = array(App::pluginPath($this->params['plugin']));
301: }
302: $patterns = array(
303: array(
304: 'a(*) -> array(*)',
305: '/\ba\((.*)\)/',
306: 'array(\1)'
307: ),
308: array(
309: 'e(*) -> echo *',
310: '/\be\((.*)\)/',
311: 'echo \1'
312: ),
313: array(
314: 'ife(*, *, *) -> !empty(*) ? * : *',
315: '/ife\((.*), (.*), (.*)\)/',
316: '!empty(\1) ? \2 : \3'
317: ),
318: array(
319: 'r(*, *, *) -> str_replace(*, *, *)',
320: '/\br\(/',
321: 'str_replace('
322: ),
323: array(
324: 'up(*) -> strtoupper(*)',
325: '/\bup\(/',
326: 'strtoupper('
327: ),
328: array(
329: 'low(*) -> strtolower(*)',
330: '/\blow\(/',
331: 'strtolower('
332: ),
333: array(
334: 'getMicrotime() -> microtime(true)',
335: '/getMicrotime\(\)/',
336: 'microtime(true)'
337: ),
338: );
339: $this->_filesRegexpUpdate($patterns);
340: }
341:
342: 343: 344: 345: 346:
347: public function request() {
348: $views = array_diff(App::path('views'), App::core('views'));
349: $controllers = array_diff(App::path('controllers'), App::core('controllers'), array(APP));
350: $components = array_diff(App::path('components'), App::core('components'));
351:
352: $this->_paths = array_merge($views, $controllers, $components);
353:
354: if (!empty($this->params['plugin'])) {
355: $pluginPath = App::pluginPath($this->params['plugin']);
356: $this->_paths = array(
357: $pluginPath . 'controllers' . DS,
358: $pluginPath . 'controllers' . DS . 'components' .DS,
359: $pluginPath . 'views' . DS,
360: );
361: }
362: $patterns = array(
363: array(
364: '$this->data -> $this->request->data',
365: '/(\$this->data\b(?!\())/',
366: '$this->request->data'
367: ),
368: array(
369: '$this->params -> $this->request->params',
370: '/(\$this->params\b(?!\())/',
371: '$this->request->params'
372: ),
373: array(
374: '$this->webroot -> $this->request->webroot',
375: '/(\$this->webroot\b(?!\())/',
376: '$this->request->webroot'
377: ),
378: array(
379: '$this->base -> $this->request->base',
380: '/(\$this->base\b(?!\())/',
381: '$this->request->base'
382: ),
383: array(
384: '$this->here -> $this->request->here',
385: '/(\$this->here\b(?!\())/',
386: '$this->request->here'
387: ),
388: array(
389: '$this->action -> $this->request->action',
390: '/(\$this->action\b(?!\())/',
391: '$this->request->action'
392: ),
393: );
394: $this->_filesRegexpUpdate($patterns);
395: }
396:
397: 398: 399: 400: 401:
402: public function configure() {
403: $this->_paths = array(
404: APP
405: );
406: if (!empty($this->params['plugin'])) {
407: $this->_paths = array(App::pluginPath($this->params['plugin']));
408: }
409: $patterns = array(
410: array(
411: "Configure::read() -> Configure::read('debug')",
412: '/Configure::read\(\)/',
413: 'Configure::read(\'debug\')'
414: ),
415: );
416: $this->_filesRegexpUpdate($patterns);
417: }
418:
419: 420: 421: 422: 423:
424: public function constants() {
425: $this->_paths = array(
426: APP
427: );
428: if (!empty($this->params['plugin'])) {
429: $this->_paths = array(App::pluginPath($this->params['plugin']));
430: }
431: $patterns = array(
432: array(
433: "LIBS -> CAKE",
434: '/\bLIBS\b/',
435: 'CAKE'
436: ),
437: array(
438: "CONFIGS -> APP . 'Config' . DS",
439: '/\bCONFIGS\b/',
440: 'APP . \'Config\' . DS'
441: ),
442: array(
443: "CONTROLLERS -> APP . 'Controller' . DS",
444: '/\bCONTROLLERS\b/',
445: 'APP . \'Controller\' . DS'
446: ),
447: array(
448: "COMPONENTS -> APP . 'Controller' . DS . 'Component' . DS",
449: '/\bCOMPONENTS\b/',
450: 'APP . \'Controller\' . DS . \'Component\''
451: ),
452: array(
453: "MODELS -> APP . 'Model' . DS",
454: '/\bMODELS\b/',
455: 'APP . \'Model\' . DS'
456: ),
457: array(
458: "BEHAVIORS -> APP . 'Model' . DS . 'Behavior' . DS",
459: '/\bBEHAVIORS\b/',
460: 'APP . \'Model\' . DS . \'Behavior\' . DS'
461: ),
462: array(
463: "VIEWS -> APP . 'View' . DS",
464: '/\bVIEWS\b/',
465: 'APP . \'View\' . DS'
466: ),
467: array(
468: "HELPERS -> APP . 'View' . DS . 'Helper' . DS",
469: '/\bHELPERS\b/',
470: 'APP . \'View\' . DS . \'Helper\' . DS'
471: ),
472: array(
473: "LAYOUTS -> APP . 'View' . DS . 'Layouts' . DS",
474: '/\bLAYOUTS\b/',
475: 'APP . \'View\' . DS . \'Layouts\' . DS'
476: ),
477: array(
478: "ELEMENTS -> APP . 'View' . DS . 'Elements' . DS",
479: '/\bELEMENTS\b/',
480: 'APP . \'View\' . DS . \'Elements\' . DS'
481: ),
482: array(
483: "CONSOLE_LIBS -> CAKE . 'Console' . DS",
484: '/\bCONSOLE_LIBS\b/',
485: 'CAKE . \'Console\' . DS'
486: ),
487: array(
488: "CAKE_TESTS_LIB -> CAKE . 'TestSuite' . DS",
489: '/\bCAKE_TESTS_LIB\b/',
490: 'CAKE . \'TestSuite\' . DS'
491: ),
492: array(
493: "CAKE_TESTS -> CAKE . 'Test' . DS",
494: '/\bCAKE_TESTS\b/',
495: 'CAKE . \'Test\' . DS'
496: )
497: );
498: $this->_filesRegexpUpdate($patterns);
499: }
500:
501: 502: 503: 504: 505: 506: 507:
508: public function components() {
509: $this->_paths = App::Path('Controller/Component');
510: if (!empty($this->params['plugin'])) {
511: $this->_paths = App::Path('Controller/Component', $this->params['plugin']);
512: }
513: $patterns = array(
514: array(
515: '*Component extends Object to *Component extends Component',
516: '/([a-zA-Z]*Component extends) Object/',
517: '\1 Component'
518: ),
519: );
520:
521: $this->_filesRegexpUpdate($patterns);
522: }
523:
524: 525: 526: 527: 528:
529: public function exceptions() {
530: $controllers = array_diff(App::path('controllers'), App::core('controllers'), array(APP));
531: $components = array_diff(App::path('components'), App::core('components'));
532:
533: $this->_paths = array_merge($controllers, $components);
534:
535: if (!empty($this->params['plugin'])) {
536: $pluginPath = App::pluginPath($this->params['plugin']);
537: $this->_paths = array(
538: $pluginPath . 'controllers' . DS,
539: $pluginPath . 'controllers' . DS . 'components' .DS,
540: );
541: }
542: $patterns = array(
543: array(
544: '$this->cakeError("error400") -> throw new BadRequestException()',
545: '/(\$this->cakeError\(["\']error400["\']\));/',
546: 'throw new BadRequestException();'
547: ),
548: array(
549: '$this->cakeError("error404") -> throw new NotFoundException()',
550: '/(\$this->cakeError\(["\']error404["\']\));/',
551: 'throw new NotFoundException();'
552: ),
553: array(
554: '$this->cakeError("error500") -> throw new InternalErrorException()',
555: '/(\$this->cakeError\(["\']error500["\']\));/',
556: 'throw new InternalErrorException();'
557: ),
558: );
559: $this->_filesRegexpUpdate($patterns);
560: }
561:
562: 563: 564: 565: 566: 567: 568:
569: protected function _moveViewFiles() {
570: if (!is_dir('View')) {
571: return;
572: }
573:
574: $dirs = scandir('View');
575: foreach ($dirs as $old) {
576: if (!is_dir('View' . DS . $old) || $old === '.' || $old === '..') {
577: continue;
578: }
579:
580: $new = 'View' . DS . Inflector::camelize($old);
581: $old = 'View' . DS . $old;
582: if ($new == $old) {
583: continue;
584: }
585:
586: $this->out(__d('cake_console', 'Moving %s to %s', $old, $new));
587: if (!$this->params['dry-run']) {
588: if ($this->params['git']) {
589: exec('git mv -f ' . escapeshellarg($old) . ' ' . escapeshellarg($old . '__'));
590: exec('git mv -f ' . escapeshellarg($old . '__') . ' ' . escapeshellarg($new));
591: } else {
592: $Folder = new Folder($old);
593: $Folder->move($new);
594: }
595: }
596: }
597: }
598:
599: 600: 601: 602: 603:
604: protected function _moveAppClasses() {
605: $files = array(
606: APP . 'app_controller.php' => APP . 'Controller' . DS . 'AppController.php',
607: APP . 'controllers' . DS .'app_controller.php' => APP . 'Controller' . DS . 'AppController.php',
608: APP . 'app_model.php' => APP . 'Model' . DS . 'AppModel.php',
609: APP . 'models' . DS . 'app_model.php' => APP . 'Model' . DS . 'AppModel.php',
610: );
611: foreach ($files as $old => $new) {
612: if (file_exists($old)) {
613: $this->out(__d('cake_console', 'Moving %s to %s', $old, $new));
614:
615: if ($this->params['dry-run']) {
616: continue;
617: }
618: if ($this->params['git']) {
619: exec('git mv -f ' . escapeshellarg($old) . ' ' . escapeshellarg($old . '__'));
620: exec('git mv -f ' . escapeshellarg($old . '__') . ' ' . escapeshellarg($new));
621: } else {
622: rename($old, $new);
623: }
624: }
625: }
626: }
627:
628: 629: 630: 631: 632: 633: 634: 635: 636: 637:
638: protected function _movePhpFiles($path, $options) {
639: if (!is_dir($path)) {
640: return;
641: }
642:
643: $paths = $this->_paths;
644:
645: $this->_paths = array($path);
646: $this->_files = array();
647: if ($options['recursive']) {
648: $this->_findFiles('php');
649: } else {
650: $this->_files = scandir($path);
651: foreach ($this->_files as $i => $file) {
652: if (strlen($file) < 5 || substr($file, -4) !== '.php') {
653: unset($this->_files[$i]);
654: }
655: }
656: }
657:
658: $cwd = getcwd();
659: foreach ($this->_files as &$file) {
660: $file = $cwd . DS . $file;
661:
662: $contents = file_get_contents($file);
663: preg_match($options['regex'], $contents, $match);
664: if (!$match) {
665: continue;
666: }
667:
668: $class = $match[1];
669:
670: if (substr($class, 0, 3) === 'Dbo') {
671: $type = 'Dbo';
672: } else {
673: preg_match('@([A-Z][^A-Z]*)$@', $class, $match);
674: if ($match) {
675: $type = $match[1];
676: } else {
677: $type = 'unknown';
678: }
679: }
680:
681: preg_match('@^.*[\\\/]plugins[\\\/](.*?)[\\\/]@', $file, $match);
682: $base = $cwd . DS;
683: $plugin = false;
684: if ($match) {
685: $base = $match[0];
686: $plugin = $match[1];
687: }
688:
689: if ($options['checkFolder'] && !empty($this->_map[$type])) {
690: $folder = str_replace('/', DS, $this->_map[$type]);
691: $new = $base . $folder . DS . $class . '.php';
692: } else {
693: $new = dirname($file) . DS . $class . '.php';
694: }
695:
696: if ($file === $new) {
697: continue;
698: }
699:
700: $dir = dirname($new);
701: if (!is_dir($dir)) {
702: new Folder($dir, true);
703: }
704:
705: $this->out(__d('cake_console', 'Moving %s to %s', $file, $new), 1, Shell::VERBOSE);
706: if (!$this->params['dry-run']) {
707: if ($this->params['git']) {
708: exec('git mv -f ' . escapeshellarg($file) . ' ' . escapeshellarg($file . '__'));
709: exec('git mv -f ' . escapeshellarg($file. '__') . ' ' . escapeshellarg($new));
710: } else {
711: rename($file, $new);
712: }
713: }
714: }
715:
716: $this->_paths = $paths;
717: }
718:
719: 720: 721: 722: 723: 724:
725: protected function _filesRegexpUpdate($patterns) {
726: $this->_findFiles($this->params['ext']);
727: foreach ($this->_files as $file) {
728: $this->out(__d('cake_console', 'Updating %s...', $file), 1, Shell::VERBOSE);
729: $this->_updateFile($file, $patterns);
730: }
731: }
732:
733: 734: 735: 736: 737: 738:
739: protected function _findFiles($extensions = '') {
740: $this->_files = array();
741: foreach ($this->_paths as $path) {
742: if (!is_dir($path)) {
743: continue;
744: }
745: $Iterator = new RegexIterator(
746: new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)),
747: '/^.+\.(' . $extensions . ')$/i',
748: RegexIterator::MATCH
749: );
750: foreach ($Iterator as $file) {
751: if ($file->isFile()) {
752: $this->_files[] = $file->getPathname();
753: }
754: }
755: }
756: }
757:
758: 759: 760: 761: 762: 763: 764:
765: protected function _updateFile($file, $patterns) {
766: $contents = file_get_contents($file);
767:
768: foreach ($patterns as $pattern) {
769: $this->out(__d('cake_console', ' * Updating %s', $pattern[0]), 1, Shell::VERBOSE);
770: $contents = preg_replace($pattern[1], $pattern[2], $contents);
771: }
772:
773: $this->out(__d('cake_console', 'Done updating %s', $file), 1);
774: if (!$this->params['dry-run']) {
775: file_put_contents($file, $contents);
776: }
777: }
778:
779: 780: 781: 782: 783:
784: public function getOptionParser() {
785: $subcommandParser = array(
786: 'options' => array(
787: 'plugin' => array(
788: 'short' => 'p',
789: 'help' => __d('cake_console', 'The plugin to update. Only the specified plugin will be updated.')
790: ),
791: 'ext' => array(
792: 'short' => 'e',
793: 'help' => __d('cake_console', 'The extension(s) to search. A pipe delimited list, or a preg_match compatible subpattern'),
794: 'default' => 'php|ctp|thtml|inc|tpl'
795: ),
796: 'git' => array(
797: 'short' => 'g',
798: 'help' => __d('cake_console', 'Use git command for moving files around.'),
799: 'boolean' => true
800: ),
801: 'dry-run' => array(
802: 'short' => 'd',
803: 'help' => __d('cake_console', 'Dry run the update, no files will actually be modified.'),
804: 'boolean' => true
805: )
806: )
807: );
808:
809: return parent::getOptionParser()
810: ->description(__d('cake_console', "A shell to help automate upgrading from CakePHP 1.3 to 2.0. \n" .
811: "Be sure to have a backup of your application before running these commands."))
812: ->addSubcommand('all', array(
813: 'help' => __d('cake_console', 'Run all upgrade commands.'),
814: 'parser' => $subcommandParser
815: ))
816: ->addSubcommand('tests', array(
817: 'help' => __d('cake_console', 'Update tests class names to FooTest rather than FooTestCase.'),
818: 'parser' => $subcommandParser
819: ))
820: ->addSubcommand('locations', array(
821: 'help' => __d('cake_console', 'Move files and folders to their new homes.'),
822: 'parser' => $subcommandParser
823: ))
824: ->addSubcommand('i18n', array(
825: 'help' => __d('cake_console', 'Update the i18n translation method calls.'),
826: 'parser' => $subcommandParser
827: ))
828: ->addSubcommand('helpers', array(
829: 'help' => __d('cake_console', 'Update calls to helpers.'),
830: 'parser' => $subcommandParser
831: ))
832: ->addSubcommand('basics', array(
833: 'help' => __d('cake_console', 'Update removed basics functions to PHP native functions.'),
834: 'parser' => $subcommandParser
835: ))
836: ->addSubcommand('request', array(
837: 'help' => __d('cake_console', 'Update removed request access, and replace with $this->request.'),
838: 'parser' => $subcommandParser
839: ))
840: ->addSubcommand('configure', array(
841: 'help' => __d('cake_console', "Update Configure::read() to Configure::read('debug')"),
842: 'parser' => $subcommandParser
843: ))
844: ->addSubcommand('constants', array(
845: 'help' => __d('cake_console', "Replace Obsolete constants"),
846: 'parser' => $subcommandParser
847: ))
848: ->addSubcommand('components', array(
849: 'help' => __d('cake_console', 'Update components to extend Component class.'),
850: 'parser' => $subcommandParser
851: ))
852: ->addSubcommand('exceptions', array(
853: 'help' => __d('cake_console', 'Replace use of cakeError with exceptions.'),
854: 'parser' => $subcommandParser
855: ));
856: }
857: }
858: