27 #require_once 'Zend/Mail/Storage/Folder.php'; 32 #require_once 'Zend/Mail/Storage/Folder/Interface.php'; 37 #require_once 'Zend/Mail/Storage/Mbox.php'; 89 #require_once 'Zend/Mail/Storage/Exception.php'; 97 #require_once 'Zend/Mail/Storage/Exception.php'; 101 $this->_rootdir = rtrim(
$params->dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
105 $this->_has[
'top'] =
true;
106 $this->_has[
'uniqueid'] =
false;
121 protected function _buildFolderTree($currentDir, $parentFolder =
null, $parentGlobalName =
'')
123 if (!$parentFolder) {
128 $dh = @opendir($currentDir);
133 #require_once 'Zend/Mail/Storage/Exception.php'; 136 while (($entry = readdir($dh)) !==
false) {
138 if ($entry[0] ==
'.') {
141 $absoluteEntry = $currentDir . $entry;
142 $globalName = $parentGlobalName . DIRECTORY_SEPARATOR . $entry;
147 if (!
is_dir($absoluteEntry) ) {
151 $parentFolder->$entry = $folder;
152 $this->
_buildFolderTree($absoluteEntry . DIRECTORY_SEPARATOR, $folder, $globalName);
172 $subname = trim($rootFolder, DIRECTORY_SEPARATOR);
173 while ($currentFolder) {
174 @list($entry, $subname) = @explode(DIRECTORY_SEPARATOR, $subname, 2);
175 $currentFolder = $currentFolder->$entry;
181 if ($currentFolder->getGlobalName() != DIRECTORY_SEPARATOR . trim($rootFolder, DIRECTORY_SEPARATOR)) {
185 #require_once 'Zend/Mail/Storage/Exception.php'; 188 return $currentFolder;
202 $this->_currentFolder = (string)$globalName;
205 $folder = $this->
getFolders($this->_currentFolder);
208 $this->
_openMboxFile($this->_rootdir . $folder->getGlobalName());
211 if (!$folder->isSelectable()) {
215 #require_once 'Zend/Mail/Storage/Exception.php'; 223 #require_once 'Zend/Mail/Storage/Exception.php'; 225 'folder tree, search for an other folder and try again', 0, $e);
249 return array_merge(
parent::__sleep(), array(
'_currentFolder',
'_rootFolder',
'_rootdir'));
_buildFolderTree($currentDir, $parentFolder=null, $parentGlobalName='')
getFolders($rootFolder=null)
_isMboxFile($file, $fileIsString=true)
selectFolder($globalName)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]