Merge "Kill hitcounter remains"
[lhc/web/wiklou.git] / maintenance / convertExtensionToRegistration.php
index 5807fb6..a0dee3c 100644 (file)
@@ -26,6 +26,7 @@ class ConvertExtensionToRegistration extends Maintenance {
                'url',
                'description',
                'descriptionmsg',
+               'namemsg',
                'license-name',
                'type',
        );
@@ -35,6 +36,8 @@ class ConvertExtensionToRegistration extends Maintenance {
        public function __construct() {
                parent::__construct();
                $this->mDescription = 'Converts extension entry points to the new JSON registration format';
+               $this->addArg( 'path', 'Location to the PHP entry point you wish to convert', /* $required = */ true );
+               $this->addOption( 'skin', 'Whether to write to skin.json', false, false );
        }
 
        protected function getAllGlobals() {
@@ -85,7 +88,8 @@ class ConvertExtensionToRegistration extends Maintenance {
                }
                $out += $this->json;
 
-               $fname = "{$this->dir}/extension.json";
+               $type = $this->hasOption( 'skin' ) ? 'skin' : 'extension';
+               $fname = "{$this->dir}/$type.json";
                $prettyJSON = FormatJson::encode( $out, "\t", FormatJson::ALL_OK );
                file_put_contents( $fname, $prettyJSON . "\n" );
                $this->output( "Wrote output to $fname.\n" );