protected function extract(array $files)
    {
        foreach ($files as $key => $file) {
            if ($file instanceof Doozr_Request_File) {

                // Simple security layer
                $filename = $this->cleanFilename($file->getClientFilename());

                // @todo Move to a basic validation applied always for files if enabled in configuration.
                #$mediaType = $this->getMimeTypeByExtension(pathinfo($filename)['extension']);

                /* @var Doozr_Request_File $file */
                // Put everything in a simple array structure ...
                $files[$key] = [
                    'name'     => $filename,
                    'type'     => $file->getClientMediaType(),
                    'tmp_name' => $file->getTemporaryName(),
                    'error'    => $file->getError(),
                    'size'     => $file->getSize(),
                    'emulated' => false,
                ];
            } else {
                $files[$key] = $this->extract($file);
            }
        }

        return $files;
    }
protected function extract(array $files)
    {
        foreach ($files as $key => $file) {
            if ($file instanceof Doozr_Request_File) {

                // Simple security layer
                $filename = $this->cleanFilename($file->getClientFilename());

                // @todo Move to a basic validation applied always for files if enabled in configuration.
                #$mediaType = $this->getMimeTypeByExtension(pathinfo($filename)['extension']);

                /* @var Doozr_Request_File $file */
                // Put everything in a simple array structure ...
                $files[$key] = [
                    'name'     => $filename,
                    'type'     => $file->getClientMediaType(),
                    'tmp_name' => $file->getTemporaryName(),
                    'error'    => $file->getError(),
                    'size'     => $file->getSize(),
                    'emulated' => false,
                ];
            } else {
                $files[$key] = $this->extract($file);
            }
        }

        return $files;
    }
protected function extract ( array $ files ) { foreach ( $ files as $ key => $ file ) { if ( $ file instanceof Doozr_Request_File ) { // Simple security layer $ filename = $ this -> cleanFilename ( $ file -> getClientFilename ( ) ) ; // @todo Move to a basic validation applied always for files if enabled in configuration. #$mediaType = $this->getMimeTypeByExtension(pathinfo($filename)['extension']); /* @var Doozr_Request_File $file */ // Put everything in a simple array structure ... $ files [ $ key ] = [ 'name' => $ filename , 'type' => $ file -> getClientMediaType ( ) , 'tmp_name' => $ file -> getTemporaryName ( ) , 'error' => $ file -> getError ( ) , 'size' => $ file -> getSize ( ) , 'emulated' => false , ] ; } else { $ files [ $ key ] = $ this -> extract ( $ file ) ; } } return $ files ; }
Extracts the file information as flat array.

@param array $files File array to parse

@author Benjamin Carl <opensource@clickalicious.de>

@return array Resulting array
Extracts the file information as flat array .