public static function build(Event $event)
 {
     $extras = parent::getExtras($event);
     $config = $extras['dummyteam-parameters'];
     if (!isset($config['destination-folder'])) {
         throw new \InvalidArgumentException('You must set installation path in extra.dummyteam-parameters.destination-folder');
     }
     if (!isset($config['wordpress-folder'])) {
         throw new \InvalidArgumentException('You must set wordpress folder name in extra.dummyteam-parameters.wordpress-folder');
     }
     if (!isset($config['wp-content-folder'])) {
         throw new \InvalidArgumentException('You must set wp-content folder name in extra.dummyteam-parameters.wp-content-folder');
     }
     // prepare output
     $io = $event->getIO();
     $io->write('<info>Prepare the directory structure</info>');
     // write the new parameters to target file
     if (!file_exists($config['destination-folder'] . $config['wp-content-folder'])) {
         mkdir($config['destination-folder'] . $config['wp-content-folder']);
     }
     $targetFile = $config['destination-folder'] . 'index.php';
     $f = fopen($targetFile, 'w');
     fwrite($f, "\n<?php\ndefine('WP_USE_THEMES', true);\ndefine('WP_CONTENT_DIR', dirname(__FILE__).'/wp-content');\nrequire(dirname(__FILE__).'/" . $config['wordpress-folder'] . "wp-blog-header.php');\n        ");
     fclose($f);
     $io->write('<info>Create index file.</info>');
 }
 public static function getExtras(Event $event)
 {
     $extras = parent::getExtras($event);
     if (!isset($extras['dummyteam-parameters']['destination-folder'])) {
         $extras['dummyteam-parameters']['destination-folder'] = $extras['webroot-dir'] ? $extras['webroot-dir'] . '/../' : 'web/';
     }
     if (!isset($extras['dummyteam-parameters']['wordpress-folder'])) {
         throw new \InvalidArgumentException('You must set wordpress folder name in extra.dummyteam-parameters.wordpress-folder');
     }
     if (!isset($extras['dummyteam-parameters']['parameter-file'])) {
         throw new \InvalidArgumentException('You must set wordpress config file path in  extra.dummyteam-parameters.parameter-file');
     }
     if (!file_exists($extras['dummyteam-parameters']['destination-folder'] . $extras['dummyteam-parameters']['wordpress-folder'] . $extras['dummyteam-parameters']['parameter-file'])) {
         throw new \InvalidArgumentException('File "' . $extras['dummyteam-parameters']['parameter-file'] . '" set in extra.dummyteam-parameters.parameter-file doesn\'t exist');
     }
     return $extras;
 }