本文整理汇总了PHP中Zend::Exception方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend::Exception方法的具体用法?PHP Zend::Exception怎么用?PHP Zend::Exception使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend
的用法示例。
在下文中一共展示了Zend::Exception方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: selectFolder
/**
* select given folder
*
* folder must be selectable!
*
* @param Zend_Mail_Folder|string global name of folder or instance for subfolder
* @throws Zend_Mail_Exception
*/
public function selectFolder($globalName)
{
// TODO: check $globalName for ..! could be user submitted data
$this->_currentFolder = (string) $globalName;
// rootdir is same as INBOX in maildir
if (strpos($this->_currentFolder, 'INBOX') === 0) {
$this->_currentFolder = substr($this->_currentFolder, 6);
}
try {
$this->_openMaildir($this->_currentFolder ? $this->_rootdir . '.' . $this->_currentFolder : $this->_rootdir);
} catch (Zend_Mail_Exception $e) {
// check what went wrong
// if folder does not exist getFolders() throws an exception
if (!$this->getFolders($this->_currentFolder)->isSelectable()) {
throw Zend::Exception('Zend_Mail_Exception', "{$this->_currentFolder} is not selectable");
}
// seems like file has vanished; rebuilding folder tree - but it's still an exception
$this->_buildFolderTree($this->_rootdir);
throw Zend::Exception('Zend_Mail_Exception', 'seems like the mbox file has vanished, I\'ve rebuild the ' . 'folder tree, search for an other folder and try again');
}
}