Example #1
0
    protected function configure()
    {
        parent::configure();
        $this->setName('site:create')->setDescription('Create a new Joomla site from scratch')->setHelp(<<<EOF
To create a site with the latest Joomla version, run:

    <info>joomla site:create foobar</info>

The newly installed site will be available at <comment>/var/www/foobar</comment> and <comment>foobar.dev</comment> after that. You can login into your fresh Joomla installation using these credentials: admin/admin.
By default, the web server root is set to <comment>/var/www</comment>. You can pass <comment>–www=/my/server/path</comment> to commands for custom values.

The console can also install the Joomlatools Platform out of the box by adding the <comment>--repo=platform</comment> flag:

    <info>joomla site:create joomlatools-platform --repo=platform</info>

You can choose the Joomla version or the sample data to be installed. A more elaborate example:

    <info>joomla site:create testsite --release=2.5 --sample-data=blog</info>
EOF
)->addOption('release', null, InputOption::VALUE_REQUIRED, "Joomla version. Can be a release number (2, 3.2, ..) or branch name. Run `joomla versions` for a full list.\nUse \"none\" for an empty virtual host.", 'latest')->addOption('sample-data', null, InputOption::VALUE_REQUIRED, 'Sample data to install (default|blog|brochure|learn|testing)')->addOption('symlink', null, InputOption::VALUE_REQUIRED, 'A comma separated list of directories to symlink from the projects directory. Use \'all\' to symlink every folder.')->addOption('repo', null, InputOption::VALUE_REQUIRED, 'Alternative Git repository to clone. To use joomlatools/platform, use --repo=platform.')->addOption('clear-cache', null, InputOption::VALUE_NONE, 'Update the list of available tags and branches from the Joomla repository')->addOption('projects-dir', null, InputOption::VALUE_REQUIRED, 'Directory where your custom projects reside', sprintf('%s/Projects', trim(`echo ~`)))->addOption('http-port', null, InputOption::VALUE_REQUIRED, 'The HTTP port the virtual host should listen to', Util::isJoomlatoolsBox() ? 8080 : 80)->addOption('disable-ssl', null, InputOption::VALUE_NONE, 'Disable SSL for this site')->addOption('ssl-crt', null, InputOption::VALUE_REQUIRED, 'The full path to the signed cerfificate file', '/etc/apache2/ssl/server.crt')->addOption('ssl-key', null, InputOption::VALUE_REQUIRED, 'The full path to the private cerfificate file', '/etc/apache2/ssl/server.key')->addOption('ssl-port', null, InputOption::VALUE_REQUIRED, 'The port on which the server will listen for SSL requests', '443')->addOption('interactive', null, InputOption::VALUE_NONE, 'Prompt for configuration details');
    }
Example #2
0
 protected function configure()
 {
     parent::configure();
     $this->setName('vhost:create')->setDescription('Creates a new Apache2 virtual host')->addOption('http-port', null, InputOption::VALUE_REQUIRED, 'The HTTP port the virtual host should listen to', Util::isJoomlatoolsBox() ? 8080 : 80)->addOption('disable-ssl', null, InputOption::VALUE_NONE, 'Disable SSL for this site')->addOption('ssl-crt', null, InputOption::VALUE_REQUIRED, 'The full path to the signed cerfificate file', '/etc/apache2/ssl/server.crt')->addOption('ssl-key', null, InputOption::VALUE_REQUIRED, 'The full path to the private cerfificate file', '/etc/apache2/ssl/server.key')->addOption('ssl-port', null, InputOption::VALUE_REQUIRED, 'The port on which the server will listen for SSL requests', '443');
 }