protected function execute(InputInterface $input, OutputInterface $output)
 {
     $instances = Instances::getInstances();
     foreach ($instances as $instance) {
         $output->writeln($instance['name'] . "\t" . $instance['version'] . "\t" . $instance['path']);
     }
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $name = $input->getArgument('name');
     $versions = Instances::getAllVersions($name);
     foreach ($versions as $version) {
         $output->writeln($version[0]);
     }
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $name = $input->getArgument('name');
     while (empty($name)) {
         $name = readline('What do you want to call the project? ');
     }
     $tab = '    ';
     $output->writeln("create-instance {$tab} {$name}");
     error_reporting(E_ERROR | E_PARSE);
     Instances::createInstances($name);
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $name = $input->getArgument('name');
     while (empty($name)) {
         $name = readline('Which instance do you want to remove? ');
     }
     $tab = '    ';
     $output->writeln("rememove-instance {$tab} {$name}");
     error_reporting(E_ERROR | E_PARSE);
     Instances::deleteInstances($name);
 }
        mkdir('instances');
    }
    return $response->withHeader('Content-Type', 'application/json')->getBody()->write(json_encode(true));
});
$app->get('/getInstances', function (Request $request, Response $response) {
    $projects = \SDK\Util\Instances::getInstances();
    return $response->withHeader('Content-Type', 'application/json')->getBody()->write(json_encode($projects));
});
$app->get('/addInstance/{name}', function (Request $request, Response $response) {
    $name = $request->getAttribute('name');
    $exists = array('output' => \SDK\Util\Instances::createInstances($name));
    return $response->withHeader('Content-Type', 'application/json')->getBody()->write(json_encode($exists));
});
$app->get('/deleteInstance/{name}', function (Request $request, Response $response) {
    $name = $request->getAttribute('name');
    $exists = array('output' => \SDK\Util\Instances::deleteInstances($name));
    return $response->withHeader('Content-Type', 'application/json')->getBody()->write(json_encode($exists));
});
$app->get('/phpmyadmin', function (Request $request, Response $response) {
    $ret = false;
    if (is_dir(__DIR__ . '/phpmyadmin')) {
        $ret = true;
    }
    return $response->withHeader('Content-Type', 'application/json')->getBody()->write(json_encode($ret));
});
$app->get('/rscanInstance/{name}[/{ext:.*}]', function (Request $request, Response $response) {
    $ret = false;
    $name = $request->getAttribute('name');
    $ext = explode('/', $request->getAttribute('ext'));
    $ret = array($name, $ext);
    $path = realpath('instances' . DIRECTORY_SEPARATOR . $name);
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $name = $input->getArgument('name');
     $version = $input->getArgument('version');
     $output->writeln(Instances::switchToVersion($name, $version));
 }