Ejemplo n.º 1
0
    function eZMimeType()
    {
        $this->SuffixList = array();
        $this->PrefixList = array();
        $this->MIMEList = array();

        $ini = eZINI::instance( 'mime.ini' );
        $this->QuickMIMETypes = array();
        foreach ( $ini->groups() as $extension => $blockValues )
        {
            foreach ( $blockValues['Types'] as $type )
            {
                $this->QuickMIMETypes[] = array( $extension, $type );
            }
        }

        foreach ( $this->QuickMIMETypes as $quickMIMEType )
        {
            $mimeEntry =& $this->MIMEList[$quickMIMEType[1]];
            if ( !isset( $mimeEntry ) )
                $mimeEntry = array( 'suffixes' => array(),
                                    'prefixes' => false );
            $mimeEntry['suffixes'][] = $quickMIMEType[0];
        }

        eZMimeType::prepareSuffixList( $this->SuffixList, $this->MIMEList );
        eZMimeType::preparePrefixList( $this->PrefixList, $this->MIMEList );
    }