code/filesystem/mimetype/mimetype.php
public function registerResolver($resolver, array $config = array())
    {
        if(!($resolver instanceof FilesystemMimetypeInterface))
        {
            if(is_string($resolver) && strpos($resolver, '.') === false )
            {
                $identifier = $this->getIdentifier()->toArray();
                $identifier['path'][] = 'mimetype';
                $identifier['name'] = $resolver;

                $identifier = $this->getIdentifier($identifier);
            }
            else $identifier = $this->getIdentifier($resolver);

            $resolver = $identifier;
        }
        else $identifier = $resolver->getIdentifier();

        //Merge the config for the resolver
        $identifier->getConfig()->merge($config);

        //Store the resolver
        $name = $identifier->name;

        if(isset($this->__resolvers[$name])) {
            unset($this->__resolvers[$name]);
        }

        $this->__resolvers[$name] = $resolver;

        return $this;
    }
public function registerResolver($resolver, array $config = array())
    {
        if(!($resolver instanceof FilesystemMimetypeInterface))
        {
            if(is_string($resolver) && strpos($resolver, '.') === false )
            {
                $identifier = $this->getIdentifier()->toArray();
                $identifier['path'][] = 'mimetype';
                $identifier['name'] = $resolver;

                $identifier = $this->getIdentifier($identifier);
            }
            else $identifier = $this->getIdentifier($resolver);

            $resolver = $identifier;
        }
        else $identifier = $resolver->getIdentifier();

        //Merge the config for the resolver
        $identifier->getConfig()->merge($config);

        //Store the resolver
        $name = $identifier->name;

        if(isset($this->__resolvers[$name])) {
            unset($this->__resolvers[$name]);
        }

        $this->__resolvers[$name] = $resolver;

        return $this;
    }
public function registerResolver ( $ resolver , array $ config = array ( ) ) { if ( ! ( $ resolver instanceof FilesystemMimetypeInterface ) ) { if ( is_string ( $ resolver ) && strpos ( $ resolver , '.' ) === false ) { $ identifier = $ this -> getIdentifier ( ) -> toArray ( ) ; $ identifier [ 'path' ] [ ] = 'mimetype' ; $ identifier [ 'name' ] = $ resolver ; $ identifier = $ this -> getIdentifier ( $ identifier ) ; } else $ identifier = $ this -> getIdentifier ( $ resolver ) ; $ resolver = $ identifier ; } else $ identifier = $ resolver -> getIdentifier ( ) ; //Merge the config for the resolver $ identifier -> getConfig ( ) -> merge ( $ config ) ; //Store the resolver $ name = $ identifier -> name ; if ( isset ( $ this -> __resolvers [ $ name ] ) ) { unset ( $ this -> __resolvers [ $ name ] ) ; } $ this -> __resolvers [ $ name ] = $ resolver ; return $ this ; }
Registers a new mime type resolver.

The last added mimetype resolver is preferred over previously registered ones.

@param   mixed $resolver An object that implements FilesystemMimetypeInterface, ObjectIdentifier object
or valid identifier string
@param  array $config  An optional associative array of configuration options
@return $this
Registers a new mime type resolver .