当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend::Exception方法代码示例

本文整理汇总了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');
     }
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:29,代码来源:Maildir.php


注:本文中的Zend::Exception方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。