2017 © Pedro Peláez
 

library file

Provides an easier way to manipulate file for common use like move,rename etc.

image

anekdotes/file

Provides an easier way to manipulate file for common use like move,rename etc.

  • Thursday, November 17, 2016
  • by anekdotes
  • Repository
  • 2 Watchers
  • 0 Stars
  • 493 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 1 % Grown

The README.md

Anekdotes File

Latest Stable Version Build Status StyleCI License Total Downloads, (*1)

A library that provides an easy way to manipulate files for common uses such as move, rename etc., (*2)

Installation

Install via composer into your project:, (*3)

composer require anekdotes/file

Usage

Use the class where ever you need it:, (*4)

use Anekdotes\File\File;

Note : This requires autoloading namespaces. Using composer to do autoloading helps a lot., (*5)

Methods

Multiple static methods are available:, (*6)

get

Get the content of a file., (*7)

  • $path: path of the file
  • $default: closure or string
File::get($path, $default = null);

exists

Check if file exists., (*8)

  • $path: path of the file
File::exists($path)

Put

Create a new file., (*9)

  • $path: path of the desired file location
  • $contents: content of the file
File::put($path, $contents)

size

Get the file size in bytes., (*10)

  • $path: path of the file
File::size($path)

delete

Delete a file., (*11)

  • $path: path of the file
File::delete($path)

move

Move/rename a file., (*12)

  • $path: path of the file to move
  • $target: target of the file
File::move($path, $target)

copy

Copy a file., (*13)

  • $path: path of the file to copy
  • $target: target of the file
File::copy($path, $target)

extension

Get the file extension., (*14)

  • $path: path of the file
File::extension($path)
```php

#### isDirectory

Check if path is a directory.

* **$path**: path of the directory

```php
isDirectory($directory)

glob

Returns an array of all files/folder inside a directory, (*15)

  • $path: path of the directory
File::glob($path)

directories

Returns an array of all folders inside a directory, (*16)

  • $path: path of the directory
File::directories($path)

files

Returns an array of all files inside a directory, (*17)

  • $directory: path of the directory
File::files($directory)

isFile

Check if path is a file., (*18)

  • $path: path of the file
File::isFile($file)

makeDirectory

Create a directory., (*19)

  • $path: desired path
  • $mode: folder mod
File::makeDirectory($path, $mode = 0777)

deleteDirectory

Delete a directory., (*20)

  • $directory: path of directory
File::deleteDirectory($directory)

The Versions

17/11 2016

dev-master

9999999-dev https://github.com/anekdotes/file

Provides an easier way to manipulate file for common use like move,rename etc.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

file directory rename move

15/11 2016

1.0.4

1.0.4.0 https://github.com/anekdotes/file

Provides an easier way to manipulate file for common use like move,rename etc.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

file directory rename move

14/10 2016

1.0.3

1.0.3.0 https://github.com/anekdotes/file

Provides an easier way to manipulate file for common use like move,rename etc.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

file directory rename move

18/03 2016

1.0.2

1.0.2.0 https://github.com/anekdotes/file

Provides an easier way to manipulate file for common use like move,rename etc.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

file directory rename move

18/03 2016

1.0.1

1.0.1.0 https://github.com/anekdotes/file

Provides an easier way to manipulate file for common use like move,rename etc.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

file directory rename move

18/03 2016

1.0.0

1.0.0.0 https://github.com/anekdotes/file

Provides an easier way to manipulate file for common use like move,rename etc.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

file directory rename move