The only thing I miss the the example use in a docblock :)
switch ($this->get('system.session.storage', 'file'))
{
case 'database':
// Set column names
$cols = (array) $this->get('system.session.table_options');
$handler = new JoomlaDbSessionHandler($this->getContainer('db'), $cols);
break;
case 'file':
$path = true === $this->get('main_site') ? INCS_PATH .'/tmp' : SITES_PATH . $this->get('site.domain_alias') .'/tmp';
$save_path = $this->get('system.session.save_path', $path);
$handler = new NativeFileSessionHandler($save_path);
break;
default:
$handler = null;
break;
}
$options = (array) $this->get('system.session.storage_options');
$storage = new NativeSessionStorage($options, $handler);
$this->session = new Session($storage);
$this->session->start();
$registry = $this->session->get('registry');
if (is_null($registry))
{
$this->session->set('registry', new Registry('session'));
}
By the way, would you be interested in placing some of the classes on packagist?
I was thinking about setting a repo/ organisation similar to FriendsOfSymfony so our community would have central place for packages that don't belong into core.
I really like it.The only thing I miss the the example use in a docblock :)
use Symfony\Component\HttpFoundation \Session\Session;
use Vscp\Session\JoomlaDbSessionHandler ;
$session = new Session(new JoomlaDbSessionHandler($db, array()));
By the way, would you be interested in placing some of the classes on packagist?I was thinking about setting a repo/ organisation similar to FriendsOfSymfony so our community would have central place for packages that don't belong into core.
On Saturday, March 15, 2014 2:29:54 PM UTC+1, Sven Versteegen wrote:I just changed some things in my app to use the Symfony Session package and I like it, I would vote to delete the current Joomla Session package.
Maybe just replace it with some classes we can use with Symfony session, like a database handler what uses Joomla\Database\DatabaseDriver.
That said, you're invited to give that handler a test: JoomlaDbSessionHandler
Am Freitag, 14. März 2014 09:52:32 UTC+1 schrieb piotr_cz:I'd say that the current Session packagage is not used by developers much, thus is somehow forgotten and still contains some legacy code.I think we should reevaluate the pros of having own Session package in the framework, Symfony one is really good but (as most of Symfony packages) my be over-engineered, if someone like me likes to peek into the code and learn how things work under the hood.