【问题标题】:Error on Zend_Session::namespaceUnset('Default');Zend_Session::namespaceUnset('Default') 上的错误;
【发布时间】:2011-12-20 09:28:40
【问题描述】:

我对 Zend 还很陌生,我认为这个问题不会那么难回答。

我想取消设置我的整个会话命名空间(称为“默认”),并且我找到了一个可能的答案 here,但是当我使用以下代码行 Zend_Session::namespaceUnset('Default'); 时,我收到此错误:@ 987654323@

希望有人可以帮助我。

【问题讨论】:

    标签: zend-framework session


    【解决方案1】:

    如果设置为只读,则可以通过调用删除只读

    $namespace->unlock();

    此外,“默认”是 默认 命名空间名称。我总是把它改成别的东西。您还可以使用以下命令检查您尝试使用的 $namespace 是否被锁定:

    $namespace->isLocked()。这将返回命名空间状态的布尔值 true/false。

    所以...你可能拥有的是这个(来自docs):

    $userProfileNamespace = new Zend_Session_Namespace('userProfileNamespace');
    
    // marking session as read only locked
    $userProfileNamespace->lock();
    
    // unlocking read-only lock
    if ($userProfileNamespace->isLocked()) {
        $userProfileNamespace->unLock();
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-04-12
      • 2023-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-12
      相关资源
      最近更新 更多