Last active
August 29, 2015 14:14
-
-
Save javigomez/d535b37d3112a0601506 to your computer and use it in GitHub Desktop.
Get joomla staging Joomla Framework CLI app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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