public function getStorage()
{
$storage = new Horde_Kolab_Session_Storage_Sessionobjects(
- Horde_SessionObjects::singleton()
+ new Horde_SessionObjects()
);
return $storage;
}
*/
function shutdown()
{
- $session = Horde_SessionObjects::singleton();
+ $session = new Horde_SessionObjects();
$session->overwrite('horde_group', $this, false);
}
$group = null;
if (!empty($GLOBALS['conf']['group']['cache'])) {
- $session = Horde_SessionObjects::singleton();
+ $session = new Horde_SessionObjects();
$group = $session->query('horde_group');
}
class Horde_SessionObjects
{
/**
- * The singleton instance.
- *
- * @var array
- */
- static protected $_instance = array();
-
- /**
* The name of the store.
*
* @var string
protected $_sdata = null;
/**
- * Returns a reference to the global Horde_SessionObjects object, only
- * creating it if it doesn't already exist.
- *
- * This method must be invoked as:
- * $objectstore = Horde_SessionObjects::singleton();
- *
- * @return Horde_SessionObjects The Horde_SessionObjects instance.
- */
- static public function singleton($params = array())
- {
- ksort($params);
- $sig = md5(Horde_Serialize::serialize($params, Horde_Serialize::BASIC));
-
- if (!isset(self::$_instance[$sig])) {
- self::$_instance[$sig] = new self($params);
- }
-
- return self::$_instance[$sig];
- }
-
- /**
* Constructor.
*
- * @param array $params The parameter array.
+ * @param array $params Optional parameters:
* <pre>
- * Optional Parameters:
- * 'name' -- The name of the session variable to store the objects in.
- * 'size' -- The maximum size of the (non-prunable) object store.
+ * 'name' - (string) The name of the session variable to store the objects
+ * in.
+ * 'size' - (integer) The maximum size of the (non-prunable) object store.
* </pre>
*/
- protected function __construct($params = array())
+ public function __construct($params = array())
{
if (isset($params['name'])) {
$this->_name = $params['name'];
<api>beta</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Added prune() function.
+ <notes>* Remove singleton().
+ * Added prune() function.
* Initial Horde 4 package</notes>
<contents>
<dir name="/">
$signature = $app . '_' . $driver;
if (!isset($shares[$signature]) &&
!empty($GLOBALS['conf']['share']['cache'])) {
- require_once 'Horde/SessionObjects.php';
- $session = Horde_SessionObjects::singleton();
+ $session = new Horde_SessionObjects();
$shares[$signature] = $session->query('horde_share_' . $app . '_' . $driver . '1');
}
function shutdown()
{
$driver = str_replace('horde_share_', '', Horde_String::lower(get_class($this)));
- require_once 'Horde/SessionObjects.php';
- $session = Horde_SessionObjects::singleton();
+ $session = new Horde_SessionObjects();
$session->overwrite('horde_share_' . $this->_app . '_' . $driver, $this, false);
}
static public function singleton($cacheid = null)
{
if (!empty($cacheid) && !isset(self::$_instances[$cacheid])) {
- $obs = Horde_SessionObjects::singleton();
+ $obs = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
self::$_instances[$cacheid] = $obs->query($cacheid);
}
{
if ($this->_modified) {
$this->_modified = false;
- $obs = Horde_SessionObjects::singleton();
+ $obs = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
$obs->overwrite($this->_cacheid, $this, false);
}
}
}
$this->deleteAllAttachments();
- $obs = Horde_SessionObjects::singleton();
+ $obs = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
$obs->prune($this->_cacheid);
}
*/
public function reloadWindow($reload)
{
- $cacheSess = Horde_SessionObjects::singleton();
+ $cacheSess = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
$href = $cacheSess->query($reload);
$cacheSess->prune($reload);
echo Horde::wrapInlineScript(array(
*/
public function reloadWindow($reload)
{
- $cacheSess = Horde_SessionObjects::singleton();
+ $cacheSess = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
$href = $cacheSess->query($reload);
$cacheSess->prune($reload);
echo Horde::wrapInlineScript(array(
$t->set('keygen', addslashes(_("Key generation may take a long time to complete. Continue with key generation?")));
if ($_SESSION['imp']['file_upload']) {
- $cacheSess = Horde_SessionObjects::singleton();
+ $cacheSess = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
$t->set('import_url', Horde::popupJs($pgp_url, array('params' => array('actionID' => 'import_personal_public_key', 'reload' => $cacheSess->storeOid($ui->selfUrl()->setRaw(true), false)), 'height' => 275, 'width' => 750, 'urlencode' => true)));
}
if ($_SESSION['imp']['file_upload']) {
$t->set('no_source', !$GLOBALS['prefs']->getValue('add_source'));
if (!$t->get('no_source')) {
- $cacheSess = Horde_SessionObjects::singleton();
+ $cacheSess = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
$t->set('import_url', Horde::popupJs($pgp_url, array('params' => array('actionID' => 'import_public_key', 'reload' => $cacheSess->storeOid($ui->selfUrl()->setRaw(true), false)), 'height' => 275, 'width' => 750, 'urlencode' => true)));
$t->set('import_pubkey-help', Horde_Help::link('imp', 'pgp-import-pubkey'));
}
$t->set('deletekeypair', addslashes(_("Are you sure you want to delete your keypair? (This is NOT recommended!)")));
$t->set('personalkey-delete-help', Horde_Help::link('imp', 'smime-delete-personal-certs'));
} elseif ($_SESSION['imp']['file_upload']) {
- $cacheSess = Horde_SessionObjects::singleton();
+ $cacheSess = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
$t->set('import_url', Horde::popupJs($smime_url, array('params' => array('actionID' => 'import_personal_public_key', 'reload' => $cacheSess->storeOid($ui->selfUrl()->setRaw(true), false)), 'height' => 275, 'width' => 750, 'urlencode' => true)));
$t->set('import-cert-help', Horde_Help::link('imp', 'smime-import-personal-certs'));
}
if ($_SESSION['imp']['file_upload']) {
$t->set('no_source', !$GLOBALS['prefs']->getValue('add_source'));
if (!$t->get('no_source')) {
- $cacheSess = Horde_SessionObjects::singleton();
+ $cacheSess = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
$t->set('import_url', Horde::popupJs($smime_url, array('params' => array('actionID' => 'import_public_key', 'reload' => $cacheSess->storeOid($ui->selfUrl()->setRaw(true), false)), 'height' => 275, 'width' => 750, 'urlencode' => true)));
$t->set('import_pubkey-help', Horde_Help::link('imp', 'smime-import-pubkey'));
}
*/
public function shutdown()
{
- $cache = Horde_SessionObjects::singleton();
+ $cache = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
/* Store the current objects. */
foreach ($this->_cache as $key => $val) {
if (!isset($this->_cache[$field])) {
$this->_cache[$field] = array('mod' => false);
if (isset($_SESSION['ingo']['storage'][$field])) {
- $cacheSess = Horde_SessionObjects::singleton();
+ $cacheSess = $GLOBALS['injector']->getInstance('Horde_SessionObjects');
$this->_cache[$field]['ob'] = $cacheSess->query($_SESSION['ingo']['storage'][$field]);
} else {
$this->_cache[$field]['ob'] = $this->_retrieve($field, $readonly);