Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

composer create-project installer #229

Merged
merged 8 commits into from
Aug 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
"joomla/registry": "~1.2",
"joomla/string": "~1.0",
"phpmailer/phpmailer": "5.2.9",
"vlucas/phpdotenv": "2.0.*"
"vlucas/phpdotenv": "2.0.*",
"joomlatools/joomla-console": "^1.3.4"
},
"autoload": {
"psr-0": {"Platform": "install/scripts"}
},
"scripts": {
"post-create-project-cmd": "Platform\\Project::install"
}
}
56 changes: 56 additions & 0 deletions install/scripts/Platform/Project.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php
namespace Platform;

use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;

use Joomlatools\Console\Application;

class Project
{
public static function install()
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
return;
}

$input = new ArgvInput();
if ($input->hasParameterOption(array('--no-interaction', '-n'))) {
return;
}

$cwd = getcwd();
$www = dirname($cwd);
$site = basename($cwd);

$arguments = array(
'site:install',
'site' => $site,
'--www' => $www,
'--interactive' => true,
'--mysql_db_prefix' => ''
);

self::logo();

$output = new ConsoleOutput();
$output->writeln("<info>Welcome to the Joomla Platform installer!</info>");
$output->writeln("Fill in the following details to configure your new application.");

$application = new Application();
$application->run(new ArrayInput($arguments));
}

public static function logo()
{
$output = new ConsoleOutput();

$output->writeln(" ");
$output->writeln(" __ _ _____ _ _ ___ ");
$output->writeln(" __| |___ ___ _____| |___ | _ | |___| |_| _|___ ___ _____ ");
$output->writeln("| | | . | . | | | .'| | __| | .'| _| _| . | _| |");
$output->writeln("|_____|___|___|_|_|_|_|__,| |__| |_|__,|_| |_| |___|_| |_|_|_|");
$output->writeln(" ");
}
}