selectFolder example

/** * @see Zend_Mail_Storage_Exception */
            throw new Zend_Mail_Storage_Exception('no valid dirname given in params');
        }

        $this->_rootdir = rtrim($params->dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;

        $this->_delim = isset($params->delim) ? $params->delim : '.';

        $this->_buildFolderTree();
        $this->selectFolder(!empty($params->folder) ? $params->folder : 'INBOX');
        $this->_has['top'] = true;
        $this->_has['flags'] = true;
    }

    /** * find all subfolders and mbox files for folder structure * * Result is save in Zend_Mail_Storage_Folder instances with the root in $this->_rootFolder. * $parentFolder and $parentGlobalName are only used internally for recursion. * * @return null * @throws Zend_Mail_Storage_Exception */
if (!isset($params->dirname) || !is_dir($params->dirname)) {
            /** * @see Zend_Mail_Storage_Exception */
            throw new Zend_Mail_Storage_Exception('no valid dirname given in params');
        }

        $this->_rootdir = rtrim($params->dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;

        $this->_buildFolderTree($this->_rootdir);
        $this->selectFolder(!empty($params->folder) ? $params->folder : 'INBOX');
        $this->_has['top']      = true;
        $this->_has['uniqueid'] = false;
    }

    /** * find all subfolders and mbox files for folder structure * * Result is save in Zend_Mail_Storage_Folder instances with the root in $this->_rootFolder. * $parentFolder and $parentGlobalName are only used internally for recursion. * * @param string $currentDir call with root dir, also used for recursion. * @param Zend_Mail_Storage_Folder|null $parentFolder used for recursion * @param string $parentGlobalName used for rescursion * @return null * @throws Zend_Mail_Storage_Exception */
public function __construct($params)
    {
        if (is_array($params)) {
            $params = (object)$params;
        }

        $this->_has['flags'] = true;

        if ($params instanceof Zend_Mail_Protocol_Imap) {
            $this->_protocol = $params;
            try {
                $this->selectFolder('INBOX');
            } catch(Zend_Mail_Storage_Exception $e) {
                /** * @see Zend_Mail_Storage_Exception */
                throw new Zend_Mail_Storage_Exception('cannot select INBOX, is this a valid transport?', 0, $e);
            }
            return;
        }

        if (!isset($params->user)) {
            /** * @see Zend_Mail_Storage_Exception */
Home | Imprint | This part of the site doesn't use cookies.