2017 © Pedro Peláez
 

library file

File Object for In Framework

image

infw/file

File Object for In Framework

  • Saturday, May 20, 2017
  • by kpicaza
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3,461 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 14 Versions
  • 6 % Grown

The README.md

In Framework - File

Scrutinizer Code Quality Code Coverage Build Status, (*1)

File is a useful object used as base file at "In Framework" FileManager., (*2)

It can be very useful to validate file uploads., (*3)

Package contains two generic file types GenericFile and Base64File., (*4)

Installation

composer require infw/file

Usage

<?php

use InFw\File\BaseMimeTypeFactory;
use InFw\Size\BaseSizeFactory;
use InFw\File\MimeTypes;
use InFw\File\GenericFileFactory;

$config = [
    'min_size' => 20,
    'max_size' => 140000
];

$mime = new BaseMimeTypeFactory(
    MimeTypes::IMAGES
);

$size = new BaseSizeFactory(
    $config['min_size'],
    $config['max_size']
);

// Assuming your form has an input type=file field named "upload" and an input type=name named "file_name".
$fileFactory = new GenericFileFactory($mime, $size);

/** @var \InFw\File\FileInterface $file */
$file = $fileFactory->make($_FILES['upload'][0]['tmp_name'], $_POST['file_name']);

$file->getName();
$file->getMimeType();
$file->getSize();
$file->getTmpName();

The Versions

20/05 2017

dev-master

9999999-dev

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/05 2017

0.0.1.9

0.0.1.9

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/05 2017

0.0.1.8

0.0.1.8

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/05 2017

0.0.1.7

0.0.1.7

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/05 2017

0.0.1.6

0.0.1.6

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/05 2017

dev-kpicaza-patch-open-for-extension

dev-kpicaza-patch-open-for-extension

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/05 2017

0.0.1.5

0.0.1.5

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/05 2017

dev-kpicaza-patch-php7

dev-kpicaza-patch-php7

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

27/10 2016

0.0.1.4

0.0.1.4

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/10 2016

0.0.1.3

0.0.1.3

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/10 2016

dev-feature/mimefactory

dev-feature/mimefactory

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/10 2016

0.0.1.2

0.0.1.2

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/10 2016

0.0.1.1

0.0.1.1

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires

20/10 2016

0.0.1

0.0.1.0

File Object for In Framework

  Sources   Download

MIT

The Requires

 

The Development Requires