Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d8c2d30
CheckJoomlaUpdatesCommand
alikon Apr 12, 2020
91d47ef
SetConfigurationCommand
alikon Apr 12, 2020
4bc89af
GetConfigurationCommand
alikon Apr 12, 2020
31134b5
ExtensionsListCommand
alikon Apr 12, 2020
ff7e5d0
SiteUpCommand
alikon Apr 12, 2020
890b85f
SiteDownCommand
alikon Apr 12, 2020
d57330f
add commands
alikon Apr 12, 2020
8d8c4de
add commands
alikon Apr 12, 2020
66afb10
database group connection encryption options
alikon Apr 12, 2020
ea2478b
help fix
alikon Apr 12, 2020
a8a4c20
full rewrite
alikon Apr 13, 2020
e2560ca
cleaning a bit
alikon Apr 14, 2020
979b1ad
cleaning a bit
alikon Apr 14, 2020
8013453
cleaning a bit
alikon Apr 14, 2020
c6e52d7
cleaning a bit
alikon Apr 14, 2020
f14694a
Update libraries/src/Console/GetConfigurationCommand.php
alikon Apr 14, 2020
81fc024
ExtensionRemoveCommand
alikon Apr 15, 2020
890bf68
ExtensionInstallCommand
alikon Apr 15, 2020
3cc9715
version for flush assets
alikon Apr 15, 2020
a0225c3
add extension commands
alikon Apr 15, 2020
57e8fad
add extension commands
alikon Apr 15, 2020
4f06acb
Merge remote-tracking branch 'upstream/4.0-dev' into patch-105
richard67 Apr 15, 2020
f650771
PHPCS
richard67 Apr 15, 2020
57e59c4
move check-updates to core group commands
alikon Apr 16, 2020
7ad60dd
UpdateCoreCommand
alikon Apr 16, 2020
7c9643d
add update core command
alikon Apr 16, 2020
cb139e0
UpdateCoreCommand
alikon Apr 16, 2020
97d446e
fix Notice
alikon Apr 17, 2020
5913b9b
force_ssl missed
alikon Apr 19, 2020
953c70f
fixed notices when site:down site:up
alikon Apr 19, 2020
61e5202
prevent merge for old session data
alikon Apr 19, 2020
500d5c2
sanitize boolean
alikon Apr 19, 2020
dda1b9c
Fix help text of GetConfigurationCommand
richard67 Apr 19, 2020
2e3459e
Merge pull request #68 from richard67/4.0-dev-alikon-patch-105-mod-2
alikon Apr 19, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function getData()
// Merge in the session data.
if (!empty($temp))
{
$data = array_merge($data, $temp);
$data = array_merge($temp, $data);
}

// Correct error_reporting value, since we removed "development", the "maximum" should be set instead
Expand Down
1 change: 1 addition & 0 deletions installation/src/Model/ConfigurationModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ public function createConfiguration($options)
$registry->set('dbsslcipher', $options->db_sslcipher);

// Server settings.
$registry->set('force_ssl', 0);
$registry->set('live_site', '');
$registry->set('secret', UserHelper::genRandomPassword(16));
$registry->set('gzip', false);
Expand Down
13 changes: 13 additions & 0 deletions libraries/src/Application/ConsoleApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Language;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Version;
use Joomla\Console\Application;
use Joomla\DI\Container;
use Joomla\DI\ContainerAwareTrait;
Expand Down Expand Up @@ -387,4 +388,16 @@ public function setSession(SessionInterface $session): self

return $this;
}

/**
* Flush the media version to refresh versionable assets
*
* @return void
*
* @since 4.0.0
*/
public function flushAssets()
Copy link
Copy Markdown
Contributor

@wilsonge wilsonge Apr 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need to add this into the CMSApplicationInterface (and if so add it into the CliApplication)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as usual i've done a dirty hack
probably you are right

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this solved, or is it still open?

{
(new Version)->refreshMediaVersion();
}
}
148 changes: 148 additions & 0 deletions libraries/src/Console/CheckJoomlaUpdatesCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<?php
/**
* Joomla! Content Management System
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\CMS\Console;

defined('JPATH_PLATFORM') or die;

use Joomla\Component\Joomlaupdate\Administrator\Model\UpdateModel;
use Joomla\Console\Command\AbstractCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

/**
* Console command for checking if there are pending extension updates
*
* @since 4.0.0
*/
class CheckJoomlaUpdatesCommand extends AbstractCommand
{
/**
* The default command name
*
* @var string
* @since 4.0
*/
protected static $defaultName = 'core:check-updates';

/**
* Stores the Update Information
* @var UpdateModel
* @since 4.0
*/
private $updateInfo;

/**
* Initialise the command.
*
* @return void
*
* @since 4.0.0
*/
protected function configure(): void
{
$help = <<<'EOF'
The <info>%command.name%</info> Checks for Joomla updates.

<info>php %command.full_name%</info>
EOF;
$this->setDescription('Checks for Joomla updates');
$this->setHelp($help);
}

/**
* Retrieves Update Information
*
* @return mixed
*
* @since 4.0
*/
private function getUpdateInformationFromModel()
{
$app = $this->getApplication();
$updatemodel = $app->bootComponent('com_joomlaupdate')->getMVCFactory($app)->createModel('Update', 'Administrator');
$updatemodel->purge();
$updatemodel->refreshUpdates(true);

return $updatemodel;
}

/**
* Gets the Update Information
*
* @return mixed
*
* @since 4.0
*/
public function getUpdateInfo()
{
if (!$this->updateInfo)
{
$this->setUpdateInfo();
}

return $this->updateInfo;
}

/**
* Sets the Update Information
*
* @param null $info stores update Information
*
* @return void
*
* @since 4.0
*/
public function setUpdateInfo($info = null): void
{
if (!$info)
{
$this->updateInfo = $this->getUpdateInformationFromModel();
}
else
{
$this->updateInfo = $info;
}
}

/**
* Internal function to execute the command.
*
* @param InputInterface $input The input to inject into the command.
* @param OutputInterface $output The output to inject into the command.
*
* @return integer The command exit code
*
* @since __DEPLOY_VERSION__
*/
protected function doExecute(InputInterface $input, OutputInterface $output): int
{
$symfonyStyle = new SymfonyStyle($input, $output);

$model = $this->getUpdateInfo();
$data = $model->getUpdateInformation();
$symfonyStyle->title('Joomla! Updates');

if (!$data['hasUpdate'])
{
$symfonyStyle->success('You already have the latest Joomla version ' . $data['latest']);

return 0;
}

$symfonyStyle->note('New Joomla Version ' . $data['latest'] . ' is available.');

if (!isset($data['object']->downloadurl->_data))
{
$symfonyStyle->warning('We cannot find an update URL');
}

return 0;
}
}
Loading