protected function _getInfoString(&$flags)
    {
        // accessing keys is easier, faster and it removes duplicated flags
        $wanted_flags = array_flip($flags);
        if (isset($wanted_flags[Zend_Mail_Storage::FLAG_RECENT])) {
            /**
             * @see Zend_Mail_Storage_Exception
             */
            // require_once 'Zend/Mail/Storage/Exception.php';
            throw new Zend_Mail_Storage_Exception('recent flag may not be set');
        }

        $info = ':2,';
        $flags = array();
        foreach (Zend_Mail_Storage_Maildir::$_knownFlags as $char => $flag) {
            if (!isset($wanted_flags[$flag])) {
                continue;
            }
            $info .= $char;
            $flags[$char] = $flag;
            unset($wanted_flags[$flag]);
        }

        if (!empty($wanted_flags)) {
            $wanted_flags = implode(', ', array_keys($wanted_flags));
            /**
             * @see Zend_Mail_Storage_Exception
             */
            // require_once 'Zend/Mail/Storage/Exception.php';
            throw new Zend_Mail_Storage_Exception('unknown flag(s): ' . $wanted_flags);
        }

        return $info;
    }
protected function _getInfoString(&$flags)
    {
        // accessing keys is easier, faster and it removes duplicated flags
        $wanted_flags = array_flip($flags);
        if (isset($wanted_flags[Zend_Mail_Storage::FLAG_RECENT])) {
            /**
             * @see Zend_Mail_Storage_Exception
             */
            // require_once 'Zend/Mail/Storage/Exception.php';
            throw new Zend_Mail_Storage_Exception('recent flag may not be set');
        }

        $info = ':2,';
        $flags = array();
        foreach (Zend_Mail_Storage_Maildir::$_knownFlags as $char => $flag) {
            if (!isset($wanted_flags[$flag])) {
                continue;
            }
            $info .= $char;
            $flags[$char] = $flag;
            unset($wanted_flags[$flag]);
        }

        if (!empty($wanted_flags)) {
            $wanted_flags = implode(', ', array_keys($wanted_flags));
            /**
             * @see Zend_Mail_Storage_Exception
             */
            // require_once 'Zend/Mail/Storage/Exception.php';
            throw new Zend_Mail_Storage_Exception('unknown flag(s): ' . $wanted_flags);
        }

        return $info;
    }
protected function _getInfoString ( & $ flags ) { // accessing keys is easier, faster and it removes duplicated flags $ wanted_flags = array_flip ( $ flags ) ; if ( isset ( $ wanted_flags [ Zend_Mail_Storage :: FLAG_RECENT ] ) ) { /**
             * @see Zend_Mail_Storage_Exception
             */ // require_once 'Zend/Mail/Storage/Exception.php'; throw new Zend_Mail_Storage_Exception ( 'recent flag may not be set' ) ; } $ info = ':2,' ; $ flags = array ( ) ; foreach ( Zend_Mail_Storage_Maildir :: $ _knownFlags as $ char => $ flag ) { if ( ! isset ( $ wanted_flags [ $ flag ] ) ) { continue ; } $ info .= $ char ; $ flags [ $ char ] = $ flag ; unset ( $ wanted_flags [ $ flag ] ) ; } if ( ! empty ( $ wanted_flags ) ) { $ wanted_flags = implode ( ', ' , array_keys ( $ wanted_flags ) ) ; /**
             * @see Zend_Mail_Storage_Exception
             */ // require_once 'Zend/Mail/Storage/Exception.php'; throw new Zend_Mail_Storage_Exception ( 'unknown flag(s): ' . $ wanted_flags ) ; } return $ info ; }
create an info string for filenames with given flags

@param   array $flags wanted flags, with the reference you'll get the set flags with correct key (= char for flag)
@return  string info string for version 2 filenames including the leading colon
@throws  Zend_Mail_Storage_Exception
create an info string for filenames with given flags