Skip to content

Commit

Permalink
Fixing cli, not finished
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Jun 3, 2017
1 parent adc323a commit bb38347
Show file tree
Hide file tree
Showing 17 changed files with 2,047 additions and 23 deletions.
4 changes: 2 additions & 2 deletions cli/finder_indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
*
* @since 2.5
*/
class FinderCli extends JApplicationCli
class FinderCli extends \Joomla\CMS\Application\CliApplication
{
/**
* Start time for the index process
Expand Down Expand Up @@ -370,4 +370,4 @@ private function getFilters()

// Instantiate the application object, passing the class name to JCli::getInstance
// and use chaining to execute the application.
JApplicationCli::getInstance('FinderCli')->execute();
\Joomla\CMS\Application\CliApplication::getInstance('FinderCli')->execute();
29 changes: 17 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions libraries/src/CMS/Application/CliApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
use Joomla\Application\Cli\CliInput;
use Joomla\Application\Cli\CliOutput;
use Joomla\Application\Cli\Output\Stdout;
use Joomla\CMS\Session\Session;
use Joomla\Event\DispatcherAwareInterface;
use Joomla\Event\DispatcherAwareTrait;
use Joomla\Event\DispatcherInterface;
use Joomla\Registry\Registry;
use Joomla\Session\Storage\RuntimeStorage;

/**
* Base class for a Joomla! command line application.
Expand All @@ -36,7 +38,7 @@ abstract class CliApplication extends AbstractCliApplication implements Dispatch
*/
protected static $instance;

private $messages = [];
private $session;

/**
* Class constructor.
Expand Down Expand Up @@ -204,7 +206,14 @@ public function isClient($identifier)
* @since __DEPLOY_VERSION__
*/
public function getSession()
{}
{
if ($this->session == null)
{
$this->session = new Session(new RuntimeStorage());
}

return $this->session;
}

/**
* Flag if the application instance is a CLI or web based application.
Expand Down
6 changes: 3 additions & 3 deletions libraries/src/CMS/Service/Provider/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
use InvalidArgumentException;
use JApplicationHelper;
use JFactory;
use Joomla\CMS\Dispatcher\DispatcherInterface;
use Joomla\CMS\Session\Storage\JoomlaStorage;
use Joomla\CMS\Session\Validator\AddressValidator;
use Joomla\CMS\Session\Validator\ForwardedValidator;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Session\Handler;
use JSession;
use Memcache;
use Memcached;
use Redis;
Expand Down Expand Up @@ -210,10 +210,10 @@ function (Container $container)

$storage = new JoomlaStorage($input, $handler, array('cookie_lifetime' => $lifetime));

$dispatcher = $container->get('Joomla\Event\DispatcherInterface');
$dispatcher = $container->get(DispatcherInterface::class);
$dispatcher->addListener('onAfterSessionStart', array(JFactory::getApplication(), 'afterSessionStart'));

$session = new JSession($storage, $dispatcher, $options);
$session = new \Joomla\CMS\Session\Session($storage, $dispatcher, $options);
$session->addValidator(new AddressValidator($input, $session));
$session->addValidator(new ForwardedValidator($input, $session));

Expand Down
8 changes: 4 additions & 4 deletions libraries/vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -1241,12 +1241,12 @@
"source": {
"type": "git",
"url": "https://github.com/joomla-framework/session.git",
"reference": "73f24b57ec1a34ecca2d4aa98beaf1af36d06a12"
"reference": "c5b16c184a9917d70fd8475a4adadfe4a47a2aed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/joomla-framework/session/zipball/73f24b57ec1a34ecca2d4aa98beaf1af36d06a12",
"reference": "73f24b57ec1a34ecca2d4aa98beaf1af36d06a12",
"url": "https://api.github.com/repos/joomla-framework/session/zipball/c5b16c184a9917d70fd8475a4adadfe4a47a2aed",
"reference": "c5b16c184a9917d70fd8475a4adadfe4a47a2aed",
"shasum": ""
},
"require": {
Expand Down Expand Up @@ -1275,7 +1275,7 @@
"joomla/input": "The joomla/input package is required to use Address and Forwarded session validators.",
"paragonie/random_compat": "The paragonie/random_compat package is required to use Joomla\\Session\\Session on PHP 5.x."
},
"time": "2017-05-27T01:20:50+00:00",
"time": "2017-06-01T16:00:13+00:00",
"type": "joomla-package",
"extra": {
"branch-alias": {
Expand Down

0 comments on commit bb38347

Please sign in to comment.