Skip to content

Instantly share code, notes, and snippets.

@javigomez
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javigomez/d535b37d3112a0601506 to your computer and use it in GitHub Desktop.
Save javigomez/d535b37d3112a0601506 to your computer and use it in GitHub Desktop.
Get joomla staging Joomla Framework CLI app
<?php
/**
* @package Joomla
* @subpackage Tests
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Maximise error reporting.
error_reporting(E_ALL & ~E_STRICT);
ini_set('display_errors', 1);
require_once __DIR__ . '/vendor/autoload.php';
use Joomla\Application\AbstractCliApplication;
use Joomla\Filesystem\Folder;
/**
* Class GetJoomlaCli
*
* Simple Command Line Application to get the latest Joomla for running the tests
*/
class GetJoomlaCli extends AbstractCliApplication
{
protected function doExecute()
{
$this->out('Cleaning Joomla site Folder...');
$testingsite = __DIR__ . '/testingsite';
if (is_dir($testingsite))
{
Folder::delete($testingsite);
}
Folder::create($testingsite);
$this->out('Downloading Joomla...');
$repository = 'https://github.com/joomla/joomla-cms.git';
$branch = 'staging';
$command = "git clone -b ${branch} --single-branch --depth 1 ${repository} ${testingsite}";
exec($command, $output, $returnValue);
if($returnValue)
{
$this->out('Sadly we were not able to download Joomla.');
}
else
{
$this->out('Joomla Downloaded and ready for executing the tests.');
}
}
}
define('JPATH_ROOT', realpath(dirname(__DIR__)));
$app = new GetJoomlaCli;
$app->execute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment